Returns a new exception object.
public static for_action ( string $action = 'install' ) : static | ||
$action | string | Optional. The action to be performed. Defaults to 'install'. |
return | static | Exception object. |
/** * Uninstalls the given table. * * @since 3.0.0 * * @param Table $table Optional. Table object. Defaults to null. * * @return bool Whether or not the table was uninstalled successfully. * * @throws InvalidTableException if a table was neither passed, nor injected via the constructor. */ public function uninstall(Table $table = null) { $table = $table ?: $this->table; if (!$table) { throw InvalidTableException::for_action('uninstall'); } return false !== $this->db->query('DROP TABLE IF EXISTS ' . $table->name()); }