vendor/theatre/core/src/Repository/DvdzonesRepository.php line 66

Open in your IDE?
  1. <?php
  2. namespace TheatreCore\Repository;
  3. use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
  4. use Doctrine\Persistence\ManagerRegistry;
  5. use TheatreCore\Entity\Dvdzones;
  6. use TheatreCore\Traits\TheatreTrait;
  7. /**
  8.  * DvdzonesRepository
  9.  *
  10.  * This class was generated by the Doctrine ORM. Add your own custom
  11.  * repository methods below.
  12.  */
  13. class DvdzonesRepository extends ServiceEntityRepository
  14. {
  15.     use TheatreTrait;
  16.     private $em;
  17.     public $__table;
  18.     public $__table_object;
  19.     public $__idtable;
  20.     public function __construct(ManagerRegistry $registry)
  21.     {
  22.         parent::__construct($registryDvdzones::class);
  23.         $this->__table $this->getClassMetadata()->getTableName();
  24.         $this->__table_object $this->getClassMetadata()->name;
  25.         $this->__idtable $this->getClassMetadata()->getSingleIdentifierFieldName();
  26.     }
  27.     //  {{{ getDvdzones()
  28.     /** Récupérer les zones DVD
  29.      *
  30.      * @access public
  31.      * @return array  les infos sous forme de tableau
  32.      */
  33.     public function getDvdzones($select_list true)
  34.     {
  35.         $zones $this->queryAll('SELECT * FROM ' $this->__table, array());
  36.         if ($select_list) {
  37.             foreach ($zones as $z) {
  38.                 $zones_tab[$z['iddvdzone']] = $z['zone'] . ' ' $z['description'];
  39.             }
  40.         } else {
  41.             $zones_tab $zones;
  42.         }
  43.         return $zones_tab;
  44.     }
  45.     // }}}
  46.     //  {{{ getDvdzone()
  47.     /** Récupérer une zone à partir de son id
  48.      *
  49.      * @access public
  50.      * @param int $iddvdzone identifiant de la zone
  51.      * @return array
  52.      */
  53.     public function getDvdzone($iddvdzone)
  54.     {
  55.         return $this->queryRow('SELECT * FROM ' $this->__table ' WHERE iddvdzone=' . (int)$iddvdzone);
  56.     }
  57.     // }}}
  58. }