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.
39 lines
676 B
39 lines
676 B
<?php
|
|
|
|
class ArtisteGateway {
|
|
|
|
private Connection $co;
|
|
|
|
public function __construct(Connection $co)
|
|
{
|
|
$this -> co = $co;
|
|
}
|
|
|
|
public function findByName($name)
|
|
{
|
|
$query = "SELECT * FROM Artiste WHERE nom = :nom";
|
|
|
|
$this -> co -> executeQuery($query, array('nom' => array($name, PDO::PARAM_STR)));
|
|
|
|
$res = $this -> co -> getResults();
|
|
|
|
foreach ($res as $row)
|
|
{
|
|
$tab[] = new Artiste(
|
|
$row['id'],
|
|
$row['nom'],
|
|
$row['prenom'],
|
|
$row['nb'],
|
|
);
|
|
}
|
|
return $tab;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
foreach ($listNews as $news)
|
|
{
|
|
|
|
}
|