|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
<?php
|
|
|
|
|
namespace App\gateway;
|
|
|
|
|
|
|
|
|
|
use App\metier\Alumni;
|
|
|
|
|
use App\metier\Offre;
|
|
|
|
|
class OffreGateway
|
|
|
|
|
{
|
|
|
|
@ -50,4 +51,21 @@ class OffreGateway
|
|
|
|
|
':remote' => array($offre->isRemote(), \PDO::PARAM_BOOL)
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function obtenirOffres() : string
|
|
|
|
|
{
|
|
|
|
|
$alGw = new AlumniGateway(new Connection("mysql:host=localhost;dbname=dbAlica", "test", "test"));
|
|
|
|
|
$query = 'SELECT * FROM Offre';
|
|
|
|
|
$this->con->executeQuery($query, array());
|
|
|
|
|
$res = $this->con->getResults();
|
|
|
|
|
$offres = array();
|
|
|
|
|
foreach ($res as $row)
|
|
|
|
|
{
|
|
|
|
|
$alumni = $alGw->findById($row['offreur']);
|
|
|
|
|
$offre = new Offre($row['id'], $alumni, $row['nom'], $row['description'], $row['imgId'], $row['typeContrat'], $row['ville'], $row['descriptifPoste'], $row['profil'], $row['experience'], $row['niveauEtudes'], $row['mailContact'], $row['numero'], $row['siteUrl'], $row['remote']);
|
|
|
|
|
array_push($offres, $offre);
|
|
|
|
|
}
|
|
|
|
|
return $offres;
|
|
|
|
|
}
|
|
|
|
|
}
|