44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Gmarche\Table;
|
|
|
|
use App\Gmarche\Entity\Antenne;
|
|
use Framework\Database\Query;
|
|
use Framework\Database\Table;
|
|
|
|
class AntenneTable extends Table
|
|
{
|
|
protected $entity = Antenne::class;
|
|
|
|
protected $table = 'antennes';
|
|
|
|
|
|
public function findAllbyRegion(int $region_id): Query
|
|
{
|
|
$region = new RegionTable($this->pdo);
|
|
return $this->makeQuery()
|
|
->join($region->getTable() . ' as r', 'a.region_id = r.id')
|
|
->select('a.*')
|
|
->where("a.region_id = $region_id")
|
|
->order('a.name ASC');
|
|
}
|
|
/* public function getAntenne(string $antenne_slug): Query
|
|
{
|
|
//$antenne = new AntenneTable($this->pdo);
|
|
return $this->makeQuery()
|
|
->select('a.*')
|
|
->where("a.slug = $antenne_slug")
|
|
->order('a.name ASC');
|
|
}
|
|
public function findPublic(): Query
|
|
{
|
|
return $this->findAll();
|
|
}
|
|
|
|
|
|
public function findWithAntenne(int $antenne_slug): Antenne
|
|
{
|
|
return $this->findPublic()->where("a.slug = $antenne_slug")->fetch();
|
|
}*/
|
|
}
|