/** * Renvoie les ponts des rivières de la collection * @return InfrastructureCollection */ public function getPonts() { if (is_null($this->cachePonts)) { $this->cachePonts = new InfrastructureCollection(); foreach ($this as $riviere) { /** @var Riviere $riviere */ if (InfrastructureStore::existsByHexas($riviere->getHexa1(), $riviere->getHexa2())) { $this->cachePonts->ajout(InfrastructureStore::getByHexas($riviere->getHexa1(), $riviere->getHexa2())); } } } return $this->cachePonts; }
/** * Renvoie l'infrastructure pont entre les 2 hexas de la riviere * @return Infrastructure */ public function getPont() { return InfrastructureStore::getByHexas($this->getHexa1(), $this->getHexa2()); }