/** * 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'); }
/** * 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'); }
/** * 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; }
/** * 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()); }