Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Fixes #280 by allowing null ResourceEvent #281

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Server/Query/CreateFilter/AbstractCreateFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
abstract class AbstractCreateFilter implements ObjectManagerAwareInterface, QueryCreateFilterInterface
{
/**
* @param ResourceEvent $event
* @param ResourceEvent|null $event
* @param string $entityClass
* @param array $data
* @return array
*/
abstract public function filter(ResourceEvent $event, $entityClass, $data);
abstract public function filter(ResourceEvent $event = null, $entityClass, $data);

/**
* @var ObjectManager
Expand Down
4 changes: 2 additions & 2 deletions src/Server/Query/CreateFilter/DefaultCreateFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
class DefaultCreateFilter extends AbstractCreateFilter
{
/**
* @param ResourceEvent $event
* @param ResourceEvent|null $event
* @param string $entityClass
* @param array $data
* @return array
*/
public function filter(ResourceEvent $event, $entityClass, $data)
public function filter(ResourceEvent $event = null, $entityClass, $data)
{
return $data;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Server/Query/CreateFilter/QueryCreateFilterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
interface QueryCreateFilterInterface extends ObjectManagerAwareInterface
{
/**
* @param ResourceEvent $event
* @param ResourceEvent|null $event
* @param string $entityClass
* @param array $data
* @return array
*/
public function filter(ResourceEvent $event, $entityClass, $data);
public function filter(ResourceEvent $event = null, $entityClass, $data);
}
4 changes: 2 additions & 2 deletions src/Server/Query/Provider/AbstractQueryProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ public function getObjectManager()
}

/**
* @param ResourceEvent $event
* @param ResourceEvent|null $event
* @param string $entityClass
* @param array $parameters
* @return mixed This will return an ORM or ODM Query\Builder
*/
abstract public function createQuery(ResourceEvent $event, $entityClass, $parameters);
abstract public function createQuery(ResourceEvent $event = null, $entityClass, $parameters);

/**
* @param $queryBuilder
Expand Down
2 changes: 1 addition & 1 deletion src/Server/Query/Provider/DefaultOdm.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class DefaultOdm extends AbstractQueryProvider
/**
* {@inheritDoc}
*/
public function createQuery(ResourceEvent $event, $entityClass, $parameters)
public function createQuery(ResourceEvent $event = null, $entityClass, $parameters)
{
/** @var \Doctrine\Odm\MongoDB\Query\Builder $queryBuilder */
$queryBuilder = $this->getObjectManager()->createQueryBuilder();
Expand Down
4 changes: 2 additions & 2 deletions src/Server/Query/Provider/DefaultOrm.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
class DefaultOrm extends AbstractQueryProvider
{
/**
* @param ResourceEvent $event
* @param ResourceEvent|null $event
* @param string $entityClass
* @param array $parameters
* @return mixed This will return an ORM or ODM Query\Builder
*/
public function createQuery(ResourceEvent $event, $entityClass, $parameters)
public function createQuery(ResourceEvent $event = null, $entityClass, $parameters)
{
$queryBuilder = $this->getObjectManager()->createQueryBuilder();
$queryBuilder
Expand Down
4 changes: 2 additions & 2 deletions src/Server/Query/Provider/QueryProviderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
interface QueryProviderInterface extends ObjectManagerAwareInterface
{
/**
* @param ResourceEvent $event
* @param ResourceEvent|null $event
* @param string $entityClass
* @param array $parameters
* @return mixed This will return an ORM or ODM Query\Builder
*/
public function createQuery(ResourceEvent $event, $entityClass, $parameters);
public function createQuery(ResourceEvent $event = null, $entityClass, $parameters);

/**
* This function is not necessary for any but fetch-all queries
Expand Down