public function save() { $this->_mapper->access($this, 'OFS-WRITE-INFO'); if ($this->_props['name'] === NULL) { $this->_props['name'] = $this->_mapper->uniqueFilename(); } if (is_array($this->_props['properties'])) { $this->_props['properties'] = serialize($this->_props['properties']); } $this->_props['type'] = $this->getType(); $this->_props['mdate'] = M('Tools')->date()->dbDateTime(); return parent::save(); }