src/Noahtech/Sistemas/InterjamaBundle/Handler/McMonedaHandler.php line 23

Open in your IDE?
  1. <?php
  2. namespace Noahtech\Sistemas\InterjamaBundle\Handler;
  3. use Noahtech\Sistemas\InterjamaBundle\Entity\McMoneda;
  4. use Doctrine\ORM\EntityManagerInterface;
  5. use Symfony\Component\DependencyInjection\ContainerInterface;
  6. class McMonedaHandler extends BaseHandler {
  7.     public function __construct(ContainerInterface $containerEntityManagerInterface $entityManager) {
  8.         $this->container $container;
  9.         $this->entityManager $entityManager;
  10.         $this->repository $entityManager->getRepository(McMoneda::class);
  11.     }     
  12.     
  13.     public function getAllMonedas() {
  14.         $monedas $this->repository->findAll();
  15.         return $this->toarray($monedas'moneda');
  16.     }
  17.     
  18.     public function getMonedaById($id) {
  19.         return $this->repository->findOneById($id);
  20.     } 
  21. }