/**
  * Construit la collection des Rivières des hexas fournis en paramètre si la Rivière fait partie d'un des hexas
  * @param HexaCollection $hexas
  * @return void
  */
 public function ajouterRivieresACacheCollec(HexaCollection $hexas)
 {
     $hexas->resetCacheRivieres();
     $ids = ',' . $hexas->getIdsStr() . ',';
     foreach ($this as $riviere) {
         /** @var Riviere $riviere */
         if (strpos($ids, ',' . $riviere->getIdHexa1() . ',') !== false || strpos($ids, ',' . $riviere->getIdHexa2() . ',') !== false) {
             $hexas->addRiviereCache($riviere);
         }
     }
 }
Example #2
0
 /**
  * Renvoie seulement les Qgs dont l'hexa fait partie des hexas fournis en paramètre
  * @param HexaCollection $hexas
  * @return QgCollection
  */
 public function filtresParHexas(HexaCollection $hexas)
 {
     $ret = new QgCollection();
     $ids = ',' . $hexas->getIdsStr() . ',';
     foreach ($this as $qg) {
         /** @var Qg $qg */
         if (strstr($ids, ',' . $qg->getIdHexa() . ',')) {
             $ret->ajout($qg);
         }
     }
     return $ret;
 }