예제 #1
0
 /**
  * Drop materialized view
  *
  * @throws Exception
  * @throws Exception
  */
 public function drop()
 {
     if (!$this->getMviewName() || !$this->getViewName()) {
         throw new Exception('Cann\'t drop materialized view, because metadata doesn\'t contains enough information!!');
     }
     try {
         $this->_commandFactory->getCommandDrop($this->getMviewName(), $this->getViewName())->execute();
         $this->delete();
     } catch (Exception $e) {
         $this->setStatus(self::MVIEW_STATUS_INVALID)->save();
         throw $e;
     }
 }