/** * {@inheritDoc} */ public function getRoleId() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getRoleId', array()); return parent::getRoleId(); }
/** * @param Role $role * @return Role */ public function saveRole(Role $role) { $id = $role->getRoleId(); $data = $role->getArrayCopy(); if ($id > 0) { $this->update($data, array('roleId' => $id)); } else { unset($data['roleId']); $this->insert($data); } if (!$role->getRoleId()) { $role->setRoleId($this->getLastInsertValue()); } return $role; }