Пример #1
0
 private function buildData(TableObject $table)
 {
     return ['name' => $table->getName(), 'type' => $table->getType(), 'engine' => $table->getEngine(), 'collation' => $table->getCollation(), 'comment' => $table->getComment()];
 }
Пример #2
0
 public function getTables($schemaName)
 {
     $sql = "SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = :schema ORDER BY TABLE_NAME ASC";
     $statement = $this->pdo->prepare($sql);
     $statement->bindValue(':schema', $schemaName, PDO::PARAM_STR);
     $statement->execute();
     $result = [];
     foreach ($statement->fetchAll(PDO::FETCH_ASSOC) as $data) {
         $tableObject = new TableObject($data['TABLE_NAME']);
         $tableObject->setType($data['TABLE_TYPE']);
         $tableObject->setEngine($data['ENGINE']);
         $tableObject->setCollation($data['TABLE_COLLATION']);
         $tableObject->setComment($data['TABLE_COMMENT']);
         $result[] = $tableObject;
     }
     return $result;
 }