Beispiel #1
0
 public function getTemplate($id)
 {
     $model = new WsTemplate();
     $template = $model->getTemplate($id);
     if ($template !== null) {
         return $template->template_content;
     }
 }
Beispiel #2
0
 public function isValid($data)
 {
     $isValid = parent::isValid($data);
     if ($isValid) {
         $model = new WsTemplate();
         $hash = new Logic_Filter_StringToHash();
         $template = $model->getTemplateNewest($hash->filter($data['template_name']));
         if ($template !== null) {
             $isValid = FALSE;
             $this->template_name->addError("Szablon o takiej nazwie już istnieje");
         }
     }
     return $isValid;
 }
Beispiel #3
0
 /**
  * Pobranie szablonów dla Użytkownika
  * @return type
  */
 protected function _getTemplate()
 {
     $model = new WsTemplate();
     $select = $model->select()->from('ws.template', array(new Zend_Db_Expr('DISTINCT ON (template_name) template.*')))->where('ghost IS FALSE')->where('(created_by = ?', Zend_Auth::getInstance()->getIdentity()->id)->orWhere('ws_client_id = ?)', $this->_client->id)->order(array('template_name', 'version_num DESC'));
     return $model->fetchAll($select);
 }