library/Garp/Spawn/MySql/View/Abstract.php
public static function deleteAllByPostfix($postfix) {
        $adapter    = Zend_Db_Table::getDefaultAdapter();
        $config     = Zend_Registry::get('config');
        $dbName     = $config->resources->db->params->dbname;

        $queryTpl   = "SELECT table_name FROM information_schema.views WHERE table_schema = '%s' and table_name like '%%%s';";
        $statement  = sprintf($queryTpl, $dbName, $postfix);

        $views = $adapter->fetchAll($statement);
        foreach ($views as $view) {
            $viewName = $view['table_name'];
            $dropStatement = "DROP VIEW IF EXISTS `{$viewName}`;";
            $adapter->query($dropStatement);
        }
    }
public static function deleteAllByPostfix($postfix) {
        $adapter    = Zend_Db_Table::getDefaultAdapter();
        $config     = Zend_Registry::get('config');
        $dbName     = $config->resources->db->params->dbname;

        $queryTpl   = "SELECT table_name FROM information_schema.views WHERE table_schema = '%s' and table_name like '%%%s';";
        $statement  = sprintf($queryTpl, $dbName, $postfix);

        $views = $adapter->fetchAll($statement);
        foreach ($views as $view) {
            $viewName = $view['table_name'];
            $dropStatement = "DROP VIEW IF EXISTS `{$viewName}`;";
            $adapter->query($dropStatement);
        }
    }
public static function deleteAllByPostfix ( $ postfix ) { $ adapter = Zend_Db_Table :: getDefaultAdapter ( ) ; $ config = Zend_Registry :: get ( 'config' ) ; $ dbName = $ config -> resources -> db -> params -> dbname ; $ queryTpl = "SELECT table_name FROM information_schema.views WHERE table_schema = '%s' and table_name like '%%%s';" ; $ statement = sprintf ( $ queryTpl , $ dbName , $ postfix ) ; $ views = $ adapter -> fetchAll ( $ statement ) ; foreach ( $ views as $ view ) { $ viewName = $ view [ 'table_name' ] ; $ dropStatement = "DROP VIEW IF EXISTS `{$viewName}`;" ; $ adapter -> query ( $ dropStatement ) ; } }
Deletes all views in the database with given postfix.
@param String $postfix The postfix for this type of view, f.i. '_joint'
Deletes all views in the database with given postfix .