1: <?php
2: /**
3: * An entry in the global addressbook.
4: *
5: * PHP version 5
6: *
7: * @category Kolab
8: * @package Kolab_Server
9: * @author Gunnar Wrobel <wrobel@pardus.de>
10: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
11: * @link http://pear.horde.org/index.php?package=Kolab_Server
12: */
13:
14: /**
15: * This class provides methods to deal with global address book
16: * entries for Kolab.
17: *
18: * Copyright 2008-2012 Horde LLC (http://www.horde.org/)
19: *
20: * See the enclosed file COPYING for license information (LGPL). If you
21: * did not receive this file, see http://www.horde.org/licenses/lgpl21.
22: *
23: * @category Kolab
24: * @package Kolab_Server
25: * @author Gunnar Wrobel <wrobel@pardus.de>
26: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
27: * @link http://pear.horde.org/index.php?package=Kolab_Server
28: */
29: class Horde_Kolab_Server_Object_Kolab_Address extends Horde_Kolab_Server_Object_Kolabinetorgperson
30: {
31:
32: /**
33: * Attributes derived from the LDAP values.
34: *
35: * @var array
36: */
37: public $derived_attributes = array(
38: self::ATTRIBUTE_LNFN,
39: self::ATTRIBUTE_FNLN,
40: );
41:
42: /**
43: * The ldap classes for this type of object.
44: *
45: * @var array
46: */
47: static public $object_classes = array(
48: self::OBJECTCLASS_TOP,
49: self::OBJECTCLASS_INETORGPERSON,
50: self::OBJECTCLASS_KOLABINETORGPERSON,
51: );
52:
53: /**
54: * Return the filter string to retrieve this object type.
55: *
56: * @return string The filter to retrieve this object type from the server
57: * database.
58: */
59: public static function getFilter()
60: {
61: $criteria = array('AND' => array(
62: array('field' => self::ATTRIBUTE_SN,
63: 'op' => 'any'),
64: array('field' => self::ATTRIBUTE_OC,
65: 'op' => '=',
66: 'test' => self::OBJECTCLASS_INETORGPERSON),
67: array('NOT' => array(
68: array('field' => self::ATTRIBUTE_SID,
69: 'op' => 'any'),
70: ),
71: ),
72: ),
73: );
74: return $criteria;
75: }
76:
77: /**
78: * Convert the object attributes to a hash.
79: *
80: * @param string $attrs The attributes to return.
81: *
82: * @return array|PEAR_Error The hash representing this object.
83: */
84: public function toHash($attrs = null)
85: {
86: if (!isset($attrs)) {
87: $attrs = array(
88: self::ATTRIBUTE_LNFN,
89: );
90: }
91: return parent::toHash($attrs);
92: }
93: }
94: