public function __construct($class = null, $structure = null) { // Need to secure $this->class = $class; $this->structure = $structure; $this->db = OrmConfig::getConnexion(); }
private function getTables() { $db = OrmConfig::getConnexion(); $query = $db->query('SHOW TABLES FROM orm_test'); if ($query) { return $query->fetchAll(\PDO::FETCH_COLUMN); } else { exit("Table '" . $this->table . "' doesn't exists\n"); } }
private function getStructure() { $db = OrmConfig::getConnexion(); $query = $db->query('SHOW COLUMNS FROM ' . $this->table); if ($query) { return $query->fetchAll(\PDO::FETCH_COLUMN); } else { exit("Table '" . $this->table . "' doesn't exists\n"); } }