Skip to content

Commit

Permalink
DataProvider wip
Browse files Browse the repository at this point in the history
  • Loading branch information
manuxi committed Apr 2, 2021
1 parent 3bcb33a commit 50c0568
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions src/Content/EventDataItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@

namespace Manuxi\SuluEventBundle\Content;

use Manuxi\SuluEventBundle\Entity\Event;
use JMS\Serializer\Annotation as Serializer;
use Manuxi\SuluEventBundle\Entity\Event;
use Sulu\Component\SmartContent\ItemInterface;

/**
* @Serializer\ExclusionPolicy("all")
*/
class EventDataItem implements ItemInterface
{
/**
* @Serializer\Exclude
*/

private $entity;

public function __construct(Event $entity)
Expand Down
3 changes: 2 additions & 1 deletion src/Content/EventDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class EventDataProvider extends BaseDataProvider
{
private $defaultLimit = 10;
private $defaultLimit = 12;

public function getConfiguration(): ProviderConfigurationInterface
{
Expand Down Expand Up @@ -69,4 +69,5 @@ private function hasNextPage(\Countable $queryResult, ?int $limit, int $page, ?i

return $count > ($page * $pageSize);
}

}
3 changes: 1 addition & 2 deletions src/Content/EventSelectionContentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,13 @@ public function getContentData(PropertyInterface $property): array
$events[] = $event;
}
}

return $events;
}

/**
* @return mixed[]
*/
public function getViewData(PropertyInterface $property): array
public function getViewData(PropertyInterface $property)
{
return $property->getValue();
}
Expand Down

0 comments on commit 50c0568

Please sign in to comment.