public function __construct($className, \PDO $conn) { parent::__construct($className); if (!isset(self::$_objects[$this->tableName])) { self::$_objects[$this->tableName] = array(); } $this->db = $conn; if (self::$checkTableOnConstruct) { $this->checkTable(); } PDORepositoryFactory::add($this->model, $this); }