db = $db; } /** * Get all tables of database * * @return array * * @since 1.0.0 */ public function getTables() : array { $builder = new Builder($this->db); $tNames = $builder->selectTables()->execute(); $tables = []; foreach ($tNames as $name) { $tables[] = $this->getTable($name); } return $tables; } /** * Get table by name * * @param string $name Name of the table * * @return Table * * @since 1.0.0 */ public function getTable(string $name) : Table { $table = new Table(); return $table; } /** * Get fields of table * * @param string $table Name of the table * * @return array * * @since 1.0.0 */ public function getFields(string $table) : array { $builder = new Builder($this->db); $tNames = $builder->selectFields($table)->execute(); $fields = []; foreach ($tNames as $name) { $fields[] = $this->getField($table, $name); } return $fields; } /** * Get field of table * * @param string $table Name of the table * @param string $name Name of the field * * @return Field * * @since 1.0.0 */ public function getField(string $table, string $name) : Field { $field = new Field(); return $field; } }