/** * Description... * * @return void **/ public function loadReportById($id) { if (!isNull($object = $this->_mapper->storage('total')->loadObjectById($id))) { $this->_mapper->access($object, 'READ'); } return $object; }
/** * @see RM_Store_Object::save() */ public function save() { if (!$this->_existsInDb()) { $this->_mapper->access($this, 'CATEGORY.CREATE'); } if (!$this->owner_id) { $this->owner_id = -1; } if (!$this->generaltype_id && $this->name) { $this->generaltype_id = M('Guid')->get(G('generaltype-fake')); } if (!$this->cdate) { $this->cdate = M('Date')->dbDateTime(); } $mask = array(); foreach ($this->_props as $name => $value) { if ($value != $this->_propInitial($name)) { $mask = $this->_mapper->_getCheckMaskArray($name); } } $this->changed_by = me()->id(); if ($mask) { $this->_mapper->access($this, join('|', $mask)); } $this->mdate = M('Date')->dbDateTime(); return parent::save(); }
public function save() { $this->_mapper->access($this, 'WRITE'); $this->mdate = M('Tools')->date()->dbDateTime(); if ($this->stable) { $this->setName(); } parent::save(); foreach ($this->values() as $item) { $item->save(); } $this->_mapper->createStable($this); $this->_mapper->_setCollection('hide', $this, $this->_hide); $this->_mapper->_setCollection('other', $this, $this->_other); }