findAllFlux(); foreach ($result as $row){ $data[] = new Flux($row['$flux']); } return $data; } public function addFlux(Flux $flux){ $gateway = new FluxGateway(new Connection('mysql:host= londres.uca.local ; dbname= dbrorossetto', 'rorossetto', 'tpphp')); $data = $this->findFlux($flux); if ($data == array()) { $gateway->addFlux($flux); } } public function addFluxBySrc(string $flux): Flux { $gateway = new FluxGateway(new Connection('mysql:host= londres.uca.local ; dbname= dbrorossetto', 'rorossetto', 'tpphp')); $newFlux = new Flux($flux); $gateway->addFlux($newFlux); return $newFlux; } public function removeFlux(Flux $flux){ $gateway = new FluxGateway(new Connection('mysql:host= londres.uca.local ; dbname= dbrorossetto', 'rorossetto', 'tpphp')); $gateway->removeFlux($flux); } public function removeFluxBySrc(string $flux): Flux { $gateway = new FluxGateway(new Connection('mysql:host= londres.uca.local ; dbname= dbrorossetto', 'rorossetto', 'tpphp')); $newFlux = new Flux($flux); $gateway->removeFlux($newFlux); return $newFlux; } public function findFlux(Flux $flux){ $gateway = new FluxGateway(new Connection('mysql:host= londres.uca.local ; dbname= dbrorossetto', 'rorossetto', 'tpphp')); $data = array(); $result = $gateway->findFlux($flux); foreach ($result as $row){ $data[] = new Flux($row['$flux']); } return $data; } public function findFluxBySrc(string $flux){ $gateway = new FluxGateway(new Connection('mysql:host= londres.uca.local ; dbname= dbrorossetto', 'rorossetto', 'tpphp')); $data = array(); $result = $gateway->findFluxBySrc($flux); foreach ($result as $row){ $data[] = new Flux($row['$flux']); } return $data; } }