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.

40 lines
1.1 KiB

<?php
require_once("sources.php");
class GatewaySources
{
private $con;
public function __construct($con){
$this->con = $con;
}
public function addSources($sources)
{
$query = "insert into sources(link) values (:link);";
$this->con->executeQuery($query, array(':link' => array($sources->getLink(), PDO::PARAM_STR)
)
);
}
public function deleteSources($idSource)
{
$query = "delete from sources where idsource = :idsource;";
$this->con->executeQuery($query, array(':idsource' => array($idSource, PDO::PARAM_INT)
)
);
}
public function getSources()
{
$query = "SELECT * FROM sources";
$this->con->executeQuery($query, array());
$results=$this->con->getResults();
Foreach ($results as $source){
$listeSources[] = new Sources($source["link"]);
}
return $listeSources;
}
}
?>