public function save(Default_Model_ResourceUsers $role) { $data = array('userId' => $role->getUserId(), 'resourceId' => $role->getResourceId()); if (null === ($id = $role->getId())) { $id = $this->getDbTable()->insert($data); } else { $this->getDbTable()->update($data, array('id = ?' => $id)); } return $id; }