/** * Renvoie les Infrastructure liées à un Hexa * @param Hexa $hexa * @return InfrastructureCollection */ public static function getByHexa(Hexa $hexa) { $req = "SELECT * FROM infrastructure WHERE idHexa = '" . $hexa->getIdHexa() . "' OR idHexa2 = '" . $hexa->getIdHexa() . "';"; return DbHandler::collFromQuery($req, 'Infrastructure', 'InfrastructureCollection'); }
/** * Renvoie les Productions liés au Hexa fourni * @var Hexa $hexa * @return ProductionCollection */ public static function getByHexa(Hexa $hexa) { $req = "SELECT * from production WHERE idBatiment IN (SELECT batiment.idBatiment FROM batiment WHERE batiment.idHexa = " . $hexa->getIdHexa() . ")"; return DbHandler::collFromQuery($req, 'Production', 'ProductionCollection'); }
/** * Renvoie les Qg liées à un Hexa * @param Hexa $hexa * @return QgCollection */ public static function getByHexa(Hexa $hexa) { $req = "SELECT * FROM qg WHERE idHexa = '" . $hexa->getIdHexa() . "';"; return DbHandler::collFromQuery($req, 'Qg', 'QgCollection'); }
/** * @param Hexa $hexa * @return BatimentCollection */ public static function getConstruitsByHexa(Hexa $hexa) { $req = "SELECT * FROM batiment WHERE idHexa = '" . $hexa->getIdHexa() . "' AND enConstruction IN (0, -1); "; return DbHandler::collFromQuery($req, 'Batiment', 'BatimentCollection'); }
/** * Renvoie les Competences liés au Hexa fourni * @var Hexa $hexa * @return CompetenceCollection */ public static function getByHexa(Hexa $hexa) { $req = "SELECT * from competence WHERE idQg IN (SELECT qg.idQg FROM qg WHERE qg.idHexa = " . $hexa->getIdHexa() . ")"; return DbHandler::collFromQuery($req, 'Competence', 'CompetenceCollection'); }