Copyright 2008-2016 Horde LLC (http://www.horde.org/)
See the enclosed file COPYING for license information (LGPL). If you
did not receive this file, see http://www.horde.org/licenses/lgpl21.
/** * Return the new internal state for this attribute. * * @param array $changes The object data that should be updated. * * @return array The resulting internal state. * * @throws Horde_Kolab_Server_Exception If storing the value failed. */ public function update(array $changes) { $changes = parent::update($changes); if (!empty($changes)) { throw new Horde_Kolab_Server_Exception(sprintf("The value for \"%s\" may not be modified!", $this->_name)); } return $changes; }
/** * Constructor * * @param Horde_Kolab_Server_Structure_Attribute_Interface $object The object * this attribute belongs to. * @param string $name The name of this attribute. */ public function __construct(Horde_Kolab_Server_Structure_Attribute_Double $attribute, $name) { parent::__construct($attribute, $name); }
/** * Constructor * * @param Horde_Kolab_Server_Object $object The object this attribute * belongs to. * @param Horde_Kolab_Server_Composite $composite The link to the server. */ public function __construct(Horde_Kolab_Server_Object $object, Horde_Kolab_Server_Composite $composite) { parent::__construct($object, $composite, 'Openldapaci'); }
public function testMethodChangesHasResultArrayWithAddedAndDeletedValuesIfTheObjectExistsAndHadValuesForTheAttributeAndNewValuesHaveBeenProvided() { $attribute = new Horde_Kolab_Server_Object_Attribute_Value($this->object, $this->composite, 'name'); $this->object->expects($this->once())->method('exists')->with()->will($this->returnValue(true)); $this->object->expects($this->once())->method('getInternal')->with('name')->will($this->returnValue(array('a', 'c'))); $data = array('name' => array('b', 'c', 'd')); $this->assertEquals(array('add' => array('name' => array('b', 'd')), 'delete' => array('name' => array('a'))), $attribute->update($data)); }