Example #1
0
 static function fromTable($table)
 {
     $query = new ShowCreateTable($table);
     try {
         $res = \Radical\DB::Q($query->toSQL());
         $data = $res->Fetch(DBAL\Fetch::NUM);
     } catch (\Exception $ex) {
         throw new \Exception('Couldnt get Create Table (' . $ex->getMessage() . ') for ' . $table, null, $ex);
     }
     return new static($data[1]);
 }
Example #2
0
 private function getCreateTable()
 {
     if ($this->createTable) {
         return $this->createTable;
     }
     $res = new SQL\ShowCreateTable($this->table);
     $createTable = $res->Execute()->Fetch(Fetch::NUM);
     $createTable = $createTable[1];
     $this->createTable = new SQL\Parse\CreateTable($createTable);
     return $this->createTable;
 }