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/DAL/AdminGateway.php

29 lines
569 B

<?php
namespace DAL;
use PDO;
class AdminGateway
{
private $con;
/**
* @param $con
*/
public function __construct($con)
{
$this->con = $con;
}
public function login(string $login):array
{
try{
$query = 'SELECT password,mail FROM Admin WHERE name = :login;';
$this->con->executeQuery($query, array(':login' => array($login, PDO::PARAM_STR)));
return $this->con->getResults();
}catch (\PDOException $e){
throw new \Exception("PDO error");
}
}
}