/**
  * Store model in the db
  * if $model->id is null, add a new row
  * @param Application_Model_Cache $model
  */
 public function save(Application_Model_Cache $model)
 {
     $data = array('uri' => $model->getUri(), 'content' => $model->getContent(), 'cType' => $model->getCType(), 'validity' => $model->getValidity(), 'created' => $model->getCreated());
     if ($model->isNew()) {
         //unset ( $data ['id'] );
         $this->getDbTable()->insert($data);
         //$model->setId($id);
     } else {
         $this->getDbTable()->update($data, array('uri = ?' => $model->getUri()));
     }
 }
Пример #2
0
 protected function getDisableCacheButton()
 {
     $link = new X_Page_Item_PItem('core-cache-disable', X_Env::_('p_cache_disablebutton', date('d/m/Y H:i', $this->inCache->getCreated())));
     $link->setDescription(X_Env::_('p_cache_disablebutton_desc'))->setType(X_Page_Item_PItem::TYPE_CONTAINER)->setLink(array($this->getId() => '0'), 'default', false);
     return $link;
 }