/**
  * 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');
 }
Exemplo n.º 2
0
 /**
  * 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');
 }
Exemplo n.º 3
0
 /**
  * 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');
 }
Exemplo n.º 4
0
 /**
  * @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');
 }
Exemplo n.º 5
0
 /**
  * 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');
 }