Beispiel #1
0
    /**
     * @return ArrayClassIterator|Table[]
     */
    function getTables()
    {
        $sql = <<<SQL
select
  c.*
from information_schema.TABLES c
where c.TABLE_SCHEMA = ?
SQL;
        $stmt = $this->pdo->prepare($sql);
        $stmt->execute([$this->getDatabase()]);
        return new ArrayClassIterator((array) $stmt->fetchAll(\PDO::FETCH_ASSOC), Table::className());
    }
Beispiel #2
0
 private function hasTableTrait(Table $table)
 {
     return file_exists($this->getTraitsDir() . "/" . $table->name() . ".php");
 }