1: <?php
2: /**
3: * The name of a person in "firstname lastname" format.
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: * The name of a person in "firstname lastname" format.
16: *
17: * Copyright 2008-2012 Horde LLC (http://www.horde.org/)
18: *
19: * See the enclosed file COPYING for license information (LGPL). If you
20: * did not receive this file, see http://www.horde.org/licenses/lgpl21.
21: *
22: * @category Kolab
23: * @package Kolab_Server
24: * @author Gunnar Wrobel <wrobel@pardus.de>
25: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
26: * @link http://pear.horde.org/index.php?package=Kolab_Server
27: */
28: class Horde_Kolab_Server_Object_Attribute_Firstnamelastname
29: extends Horde_Kolab_Server_Object_Attribute_Value
30: {
31: /**
32: * Constructor
33: *
34: * @param Horde_Kolab_Server_Structure_Attribute_Interface $object The object
35: * this attribute belongs to.
36: * @param string $name The name of this attribute.
37: */
38: public function __construct(
39: Horde_Kolab_Server_Structure_Attribute_Double $attribute,
40: $name
41: ) {
42: parent::__construct($attribute, $name);
43: }
44:
45: /**
46: * Return the value of this attribute.
47: *
48: * @return array The value(s) of this attribute.
49: *
50: * @throws Horde_Kolab_Server_Exception If retrieval of the value failed.
51: */
52: public function value()
53: {
54: $values = $this->attribute->value();
55: return sprintf('%s %s', $values['givenName'][0], $values['sn'][0]);
56: }
57:
58: }