protected function _beforeInsert() { parent::_beforeInsert(); if (!$this->visible) { $this->visible = 0; } }
public function _beforeDelete() { parent::_beforeDelete(); $pk = $this->getModel()->getPrimaryKey(); $sourceRow = $this->getModel()->getSourceModel()->getRow($this->{$pk}); $sourceRow->delete(); }
public function delete() { $this->_model->deleteCacheDataRow($this->_getRow()); $ret = parent::delete(); $this->_model->clearCacheStore(); return $ret; }
protected function _afterDelete() { parent::_afterDelete(); if ($this->getModel()->useRecursiveIdsCache()) { $this->getModel()->getRecursiveIdsCache()->clean(); } }
protected function _beforeSave() { parent::_beforeSave(); if (!$this->component) { throw new Kwf_Exception("component can not be empty"); } }
public function toArray() { $ret = parent::toArray(); if ($this->_trlRow) { $ret = array_merge(parent::toArray(), $this->_trlRow->toArray()); } return $ret; }
protected function _beforeDelete() { $newsletter = $this->getParentRow('Newsletter'); if (in_array($newsletter->status, array('start', 'stop', 'finished'))) { throw new Kwf_ClientException(trlKwf('Can only add users to a paused newsletter')); } parent::_beforeDelete(); }
public function __get($name) { if ($name == 'columns') { throw new Kwf_Exception("Theres no field named 'columns' anymore. Getting the column count is implemented in Kwc_Basic_Table_Component->getColumnCount()"); } else { return parent::__get($name); } }
protected function _afterInsert() { Kwf_Model_Proxy_Row::_afterInsert(); //nicht parent!! //_buildContentAndSetToRow() hier nicht aufrufen, weil wir den contents selbst setzen (in der Component.php) $this->is_spam = $this->_checkIsSpam(); //sendMail() hier nicht aufrufen, da wir das selbst aufrufen nachdem der content gesetzt wurde }
protected function _afterInsert() { parent::_afterInsert(); $r = Kwf_Model_Abstract::getInstance('Kwf_Crm_Customer_Model_Comments')->createRow(); $r->customer_id = $this->id; $authedUser = Kwf_Registry::get('userModel')->getAuthedUser(); $r->value = trlKwf('Customer added by {0}', $authedUser ? $authedUser->__toString() : 'Import'); $r->save(); }
protected function _beforeUpdate() { parent::_beforeUpdate(); if (in_array('filename', $this->getDirtyColumns())) { $model = Kwf_Component_Data_Root::getInstance()->getComponentByDbId($this->component_id, array('ignoreVisible' => true))->generator->getHistoryModel(); $data = array('component_id' => $this->component_id, 'filename' => $this->getCleanValue('filename')); $row = $model->createRow($data); $row->save(); } }
public function __construct(array $config) { parent::__construct($config); if (!$this->sitemap_priority) { $this->sitemap_priority = 0.5; } if (!$this->sitemap_changefreq) { $this->sitemap_changefreq = 'weekly'; } }
public function __get($name) { $ret = null; if ($this->_trlRow->hasColumn($name)) { $ret = $this->_trlRow->{$name}; } if ($name != 'visible' && !$ret) { $ret = parent::__get($name); } return $ret; }
protected function _beforeSave() { parent::_beforeSave(); if (is_null($this->filename)) { $fRow = $this->getParentRow('File'); if ($fRow) { $filter = new Kwf_Filter_Ascii(); $this->filename = $filter->filter($fRow->filename); } } }
public function __set($name, $value) { if ($name == $this->_getPrimaryKey()) { // wenn das implementiert wird vorsicht wegen user-model. bei dem // darf der primary key zB wirklich (!) nicht geändert werden throw new Kwf_Exception_NotYetImplemented("Primary key may not be changed when using a MirrorCache"); } if (in_array($name, $this->getModel()->getOwnColumns()) && $this->{$name} != $value) { $this->_doSyncOnUpdate = true; } parent::__set($name, $value); }
public function __get($name) { if ($name == 'info_short') { $info = $this->getInfo(); return $info['shortText']; } else { if ($name == 'info') { $info = $this->getInfo(); return $info['text']; } else { if ($name == 'subject') { $model = $this->getModel()->getDependentModel('Mail'); $id = $this->component_id . '_' . $this->id . '_mail'; $mailRow = $model->getRow($id); if ($mailRow) { return $mailRow->subject; } return ''; } else { return parent::__get($name); } } } }
public function getProxiedRow() { $this->_loadRow(); return parent::getProxiedRow(); }
protected function _afterUpdate() { parent::_afterUpdate(); if ($this->_logChangedUser) { $this->writeLog('user_edited'); $this->_logChangedUser = false; } }
protected function _beforeDelete() { parent::_beforeDelete(); $this->_deleteFile(); }
protected function _afterUpdate() { parent::_afterUpdate(); if ($this->_logChangedUser) { $this->getModel()->writeLog(array('user_id' => $this->id, 'message_type' => 'user_edited')); $this->_logChangedUser = false; } }
public function duplicate(array $data = array()) { $ret = parent::duplicate($data); $this->_duplicateDependentModel($ret, 'FlashVars'); return $ret; }
protected function _init() { parent::_init(); $this->_componentClass = $this->getModel()->getComponentClass(); $this->_classes = Kwc_Abstract::getChildComponentClasses($this->_componentClass, 'child'); }
protected function _afterInsert() { parent::_afterInsert(); $this->_buildContentAndSetToRow(); $this->is_spam = $this->_checkIsSpam(); $this->sendMail(); }
protected function _beforeInsert() { parent::_beforeInsert(); $this->insert_date = date('Y-m-d H:i:s'); }
protected function _afterDelete() { parent::_afterDelete(); $this->getModel()->removeCache(); }