<?php
namespace TheatreCore\Repository;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
use TheatreCore\Entity\Dvdzones;
use TheatreCore\Traits\TheatreTrait;
/**
* DvdzonesRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class DvdzonesRepository extends ServiceEntityRepository
{
use TheatreTrait;
private $em;
public $__table;
public $__table_object;
public $__idtable;
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Dvdzones::class);
$this->__table = $this->getClassMetadata()->getTableName();
$this->__table_object = $this->getClassMetadata()->name;
$this->__idtable = $this->getClassMetadata()->getSingleIdentifierFieldName();
}
// {{{ getDvdzones()
/** Récupérer les zones DVD
*
* @access public
* @return array les infos sous forme de tableau
*/
public function getDvdzones($select_list = true)
{
$zones = $this->queryAll('SELECT * FROM ' . $this->__table, array());
if ($select_list) {
foreach ($zones as $z) {
$zones_tab[$z['iddvdzone']] = $z['zone'] . ' ' . $z['description'];
}
} else {
$zones_tab = $zones;
}
return $zones_tab;
}
// }}}
// {{{ getDvdzone()
/** Récupérer une zone à partir de son id
*
* @access public
* @param int $iddvdzone identifiant de la zone
* @return array
*/
public function getDvdzone($iddvdzone)
{
return $this->queryRow('SELECT * FROM ' . $this->__table . ' WHERE iddvdzone=' . (int)$iddvdzone);
}
// }}}
}