class SomeRepository
{
/**
* @var EntityRepository
**/
private $repository;
public function __construct(EntityManagerInterface $em)
{
$this->repository = $em->getRepository(SomeEntity::class);
}
public function find($id)
{
return $this->repository->find($id);
}
}
....
SomeController
{
public function some(SomeRepository $somes)
{
}
}