/**
  * Console application's method for checking if migrations' table installed
  * @return boolean
  */
 public static function installed()
 {
     if (QueryBuilder::showTables(static::$tableName)->exec()->fetch()) {
         return true;
     }
     return false;
 }
Beispiel #2
0
 /**
  * Searches and returns Table object
  * @param string $tableName
  * @throws Exception
  * @return Table
  */
 public static function get($tableName)
 {
     if (!QueryBuilder::showTables($tableName)->exec()->fetch()) {
         throw new Exception("table '{$tableName}' is not exist");
     }
     return new static($tableName);
 }