/**
  * @param Mana_Db_Model_Entity $object
  * @param int $id
  * @param int $sessionId
  * @return Mana_Db_Resource_Entity
  */
 public function loadEdited($object, $id, $sessionId)
 {
     $read = $this->_getReadAdapter();
     $select = $read->select()->from($this->getMainTable())->where("{$this->getMainTable()}.`edit_status` = ?", $id)->where("{$this->getMainTable()}.`edit_session_id` = ?", $sessionId);
     $data = $read->fetchRow($select);
     if ($data) {
         $object->setData($data);
     }
     $this->unserializeFields($object);
     $this->_afterLoad($object);
     return $this;
 }
 protected function _beforeSave()
 {
     if ($this->getForceIncludeFilterName() === '') {
         $this->setForceIncludeFilterName(null);
     }
     $this->setFinalIncludeFilterName($this->getForceIncludeFilterName() !== null ? $this->getForceIncludeFilterName() : $this->getIncludeFilterName());
     $this->setFinalUrlKey($this->getManualUrlKey() !== null && trim($this->getManualUrlKey()) !== '' ? $this->getManualUrlKey() : $this->getUrlKey());
     parent::_beforeSave();
     return $this;
 }
 /**
  * @param Mana_Db_Model_Entity $model
  * @param $field
  * @return bool|Varien_Simplexml_Element
  */
 public function getFieldXml($model, $field)
 {
     if ($model) {
         if ($scope = $model->getScope()) {
             return $this->dbConfigHelper()->getFieldXml($scope, $field);
         }
     }
     return false;
 }
Example #4
0
 /**
  * @param int $index
  * @param Mana_Db_Model_Entity $row
  * @return array
  */
 public function getRowClientSideBlock($index, $row)
 {
     return array('type' => 'Mana/Admin/Grid/Row', 'row_id' => $row->getId());
 }
Example #5
0
 protected function _beforeSave()
 {
     $this->overrideUpdatedAt(now());
     $this->_updateSample();
     return parent::_beforeSave();
 }