Ejemplo n.º 1
0
 /**
  * Renvoie les Competences liés aux Qgs de la collection fournie en paramètre
  * @param QgCollection $qgs
  * @return CompetenceCollection
  */
 public static function getFromQgs(QgCollection $qgs)
 {
     $ids = $qgs->getIdsStr();
     if (!$ids) {
         return new CompetenceCollection();
     }
     $req = "SELECT * FROM competence WHERE idQg IN (" . $ids . ");";
     return DbHandler::collFromQuery($req, 'Competence', 'CompetenceCollection');
 }
Ejemplo n.º 2
0
 /**
  * Renvoie les Productions liés aux Qgs de la collection fournie
  * @var QgCollection $qgs
  * @return ProductionCollection
  */
 public static function getFromQgs(QgCollection $qgs)
 {
     $req = "SELECT * from production WHERE idUnite IN (SELECT unite.idUnite FROM unite WHERE unite.idQg IN (" . $qgs->getIdsStr() . "))";
     return DbHandler::collFromQuery($req, 'Production', 'ProductionCollection');
 }
Ejemplo n.º 3
0
 /**
  * Renvoie seulement les Qgs dont l'hexa fait partie des hexas fournis en paramètre
  * @param QgCollection $qgs
  * @return UniteCollection
  */
 public function filtresParQgs(QgCollection $qgs)
 {
     $ret = new UniteCollection();
     $ids = ',' . $qgs->getIdsStr() . ',';
     foreach ($this as $unite) {
         /** @var Unite $unite */
         if (strstr($ids, ',' . $unite->getIdQg() . ',')) {
             $ret->ajout($unite);
         }
     }
     return $ret;
 }
Ejemplo n.º 4
0
 /**
  * Renvoie les Trajs liés aux Qgs de la collection fournie en paramètre
  * @param QgCollection $qgs
  * @return TrajCollection
  */
 public static function getFromQgs(QgCollection $qgs)
 {
     return self::getFromIdsQgs($qgs->getIdsStr());
 }