for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Dontdrinkandroot\Service;
use Doctrine\ORM\Tools\Pagination\Paginator;
class DelegatedCrudService implements CrudServiceInterface
{
/**
* @var CrudServiceInterface
*/
private $delegate;
public function __construct(CrudServiceInterface $delegate)
$this->delegate = $delegate;
}
* {@inheritdoc}
public function find($id): ?object
return $this->delegate->find($id);
public function findAll(): array
return $this->delegate->findAll();
public function findAllPaginated(int $page = 1, int $perPage = 50): Paginator
return $this->delegate->findAllPaginated($page, $perPage);
public function create(object $entity): object
return $this->delegate->create($entity);
public function update(object $entity): object
return $this->delegate->update($entity);
public function remove(object $entity): void
$this->delegate->remove($entity);
public function save(object $entity): object
return $this->delegate->save($entity);
protected function getDelegate(): CrudServiceInterface
return $this->delegate;