Example #1
0
 /**
  * Update system table schema
  *
  * @param string $sql
  * @param string $type Schema type: `core` or <module>, default as SqlSchema::getType()
  *
  * @return bool
  */
 protected function querySchema($sql, $type = '')
 {
     $sqlHandler = new SqlSchema();
     try {
         $sqlHandler->queryContent($sql, $type);
     } catch (\Exception $exception) {
         $this->handler->setResult('db', array('status' => false, 'message' => 'SQL schema query failed: ' . $exception->getMessage()));
         return false;
     }
     return true;
 }
Example #2
0
 /**
  * {@inheritDoc}
  */
 protected function attachDefaultListeners()
 {
     $events = $this->events;
     $events->attach('update.pre', array($this, 'updateSchema'));
     parent::attachDefaultListeners();
     return $this;
 }
Example #3
0
 /**
  * {@inheritDoc}
  */
 protected function attachDefaultListeners()
 {
     $events = $this->events;
     $events->attach('update.post', array($this, 'updateCarousel'));
     parent::attachDefaultListeners();
     return $this;
 }
Example #4
0
 protected function attachDefaultListeners()
 {
     $events = $this->events;
     $events->attach('install.post', array($this, 'postUpdate'));
     parent::attachDefaultListeners();
     return $this;
 }