Beispiel #1
0
 /**
  * @see Advertikon\Resource\ResourceInterface::delete()
  */
 public function delete()
 {
     $this->_getEvent()->setParam('model', $this->_model);
     App::getModule()->app()->getEventManager()->trigger(App::PREDELETE_EVENT, $this->_getEvent());
     $affectedRows = $this->_delete();
     $this->_getEvent()->setParam('model', $this->_model);
     App::getModule()->app()->getEventManager()->trigger(App::AFTERDELETE_EVENT, $this->_getEvent());
     return $affectedRows;
 }
Beispiel #2
0
 /**
  * Translate text
  *
  * @param string $text Text to be translated
  * @return string
  */
 public function translate($text)
 {
     if (!is_string($text)) {
         throw new InvalidArgument(sprintf('%s: Argument must be string, %s given instead', __METHOD__, gettype($text)));
     }
     if ($this->_doTranslate && $this->_element->getOption('translate') !== false) {
         $text = App::getModule()->translate($text);
     }
     return $text;
 }
Beispiel #3
0
 /**
  * @see Advertikon\Resource::load()
  */
 public function _load($param)
 {
     $this->_param = $param;
     $this->_select = $this->getSelect();
     $this->_getEvent()->setParam('select', $this->_select);
     App::getModule()->app()->getEventManager()->trigger(App::GET_SELECT_EVENT, $this->_getEvent());
     if (isset($this->_model->pageable) && $this->_model->pageable) {
         $this->paginate();
     }
     $selectString = $this->_sql->buildSqlString($this->_select);
     //echo PHP_EOL . '[DB]' . $selectString . PHP_EOL;
     $result = self::$_adapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);
     return $result;
 }