/** * Renvoie les Hexas liés aux Parties de cette collection * @return HexaCollection */ public function getHexas() { if (is_null($this->cacheHexas)) { $this->cacheHexas = HexaBusiness::getFromParties($this); $this->cacheHexas->store(); } return $this->cacheHexas; }
/** * Renvoie les Hexas liés aux Visibles de cette collection * @return HexaCollection */ public function getHexas() { if (is_null($this->cacheHexas)) { $this->cacheHexas = new HexaCollection(); foreach ($this as $visible) { /** @var Visible $visible */ $this->cacheHexas->ajout($visible->getHexa()); } } return $this->cacheHexas; }
/** * 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); } } }
/** * 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; }