You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Php_RSS/fluxRSS/model/FluxModel.php

61 lines
1.4 KiB

<?php
namespace model;
class FluxModel
{
private FluxGateway $gateway;
public function FindAllFlux(){
$data = array();
$result = $this->gateway->findAllFlux();
foreach ($result as $row){
$data[] = new Flux($row['$flux']);
}
return $data;
}
public function addFlux(Flux $flux)
{
$data = findFlux($flux);
if ($data == array()) {
$this->gateway->addFlux($flux);
}
}
public function addFluxBySrc(string $flux): Flux {
$newFlux = new Flux($flux);
$this->gateway->addFlux($newFlux);
return $newFlux;
}
public function removeFlux(Flux $flux){
$this->gateway->removeFlux($flux);
}
public function removeFluxBySrc(string $flux): Flux {
$newFlux = new Flux($flux);
$this->gateway->removeFlux($newFlux);
return $newFlux;
}
public function findFlux(Flux $flux){
$data = array();
$result = $this->gateway->findFlux($flux);
foreach ($result as $row){
$data[] = new Flux($row['$flux']);
}
return $data;
}
public function findFluxBySrc(string $flux){
$data = array();
$result = $this->gateway->findFluxBySrc($flux);
foreach ($result as $row){
$data[] = new Flux($row['$flux']);
}
return $data;
}
}