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 findAllRegions(): Query { //$region = new RegionTable($this->pdo); $table = 'regions'; return $this->makeQuery() ->select('r.*') ->order('r.name ASC'); } public function findAnyAntennes(string $tri, $antennes_select): Query { $region = new RegionTable($this->pdo); if ($tri == 'tri_alpha') { $order = 'a.name ASC'; } else { $order = 'r.name, a.name ASC'; } return $this->makeQuery() ->join($region->getTable() . ' as r', 'region_id = r.id') ->select('a.id, region_id as regionId, r.name as regionName, a.name as antenneName, r.slug as regionSlug, a.slug as antenneSlug, edito1, edito2, edito3, edito4, gmarcheAt') ->where("a.id IN ($antennes_select)") ->order($order); } public function findAllAntennes(string $tri): Query { $region = new RegionTable($this->pdo); if ($tri == 'tri_alpha') { $order = 'a.name ASC'; } else { $order = 'r.name, a.name ASC'; } return $this->makeQuery() ->join($region->getTable() . ' as r', 'region_id = r.id') ->select('a.id, region_id as regionId, r.name as regionName, a.name as antenneName, r.slug as regionSlug, a.slug as antenneSlug, edito1, edito2, edito3, edito4, gmarcheAt') ->order($order); } }