/** * 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; }
/** * 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); }