/** * Test ID generation for a person. * * @return NULL */ public function testGenerateId() { foreach ($this->servers as $server) { $a = new Horde_Kolab_Server_Object_Kolabinetorgperson($server, null, $this->objects[0]); $this->assertContains('Frank Mustermann', $a->get(Horde_Kolab_Server_Object_Person::ATTRIBUTE_UID)); } }
/** * Convert the object attributes to a hash. * * @param string $attrs The attributes to return. * * @return array|PEAR_Error The hash representing this object. */ public function toHash($attrs = null) { if (!isset($attrs)) { $attrs = array(self::ATTRIBUTE_LNFN); } return parent::toHash($attrs); }
/** * Saves object information. * * @param array $info The information about the object. * * @return boolean|PEAR_Error True on success. */ public function save(array $info) { $admin_group = new Horde_Kolab_Server_Object_Kolabgroupofnames($this->server, null, $this->required_group); $save_result = parent::save($info); if (!$admin_group->exists()) { $data = array_merge($this->required_group, array(Horde_Kolab_Server_Object_Kolabgroupofnames::ATTRIBUTE_MEMBER => array($this->uid))); } else { $result = $admin_group->isMember($this->uid); if ($result === false) { $members = $admin_group->getMembers(); $members[] = $this->uid; $data = array(Horde_Kolab_Server_Object_Kolabgroupofnames::ATTRIBUTE_MEMBER => $members); } else { $data = null; } } if (!empty($data)) { return $admin_group->save($data); } return $save_result; }
/** * Convert the object attributes to a hash. * * @param string $attrs The attributes to return. * * @return array|PEAR_Error The hash representing this object. */ public function toHash($attrs = null) { if (!isset($attrs)) { $attrs = array(self::ATTRIBUTE_SID, self::ATTRIBUTE_FN, self::ATTRIBUTE_MAIL, self::ATTRIBUTE_USERTYPE); } return parent::toHash($attrs); }