Exemplo n.º 1
0
 /**
  * Create materialized view
  *
  * @return Mage_Mview_Model_Command_Create|mixed
  * @throws Exception
  * @throws Exception
  */
 public function execute()
 {
     if ($this->_table->isExists() || $this->_view->isExists()) {
         throw new Exception('Table or view with same name already exists!!!');
     }
     try {
         $this->_view->createFromSource($this->_select);
         $this->_table->createFromSource($this->_view->getName());
     } catch (Exception $e) {
         $this->_table->drop();
         $this->_view->drop();
         throw $e;
     }
     return $this;
 }