so the code is : DAO class
abstract class DAO
{
protected $db;
protected $SQL_host='localhost';
protected $SQL_port='3306';
protected $SQL_dbname='projet';
protected $SQL_login='root';
protected $SQL_password='';
protected function __construct()
{
$this->setDb(new PDO('mysql:host='.$this->SQL_host.';port='.$this->SQL_port.';dbname='.$this->SQL_dbname, $this->SQL_login, $this->SQL_password)) ;
}
protected function setDb(PDO $bdd)
{
$this->db = $bdd ;
}
}
and child UserDAO class
class UserDAO extends DAO
{
public function __construct()
{
parent::__construct();
}
}
When UserDAO child class inherits from parent DAO, does the child get parent's attributes ? If not, how can I make so ?
I've been looking around and they mostly tell to use get function but that's really not what i'm trying to do. Thanks for your help