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.
Author: Gunnar Wrobel (wrobel@pardus.de)
Esempio n. 1
0
File: Ldap.php Progetto: horde/horde
 /**
  * Modify existing object data.
  *
  * @param Horde_Kolab_Server_Object $object The object to be modified.
  * @param array                     $data   The attributes of the object
  *                                          to be stored.
  *
  * @return NULL
  *
  * @throws Horde_Kolab_Server_Exception
  */
 public function save(Horde_Kolab_Server_Object_Interface $object, array $data)
 {
     $changes = new Horde_Kolab_Server_Ldap_Changes($object, $data);
     try {
         $entry = $this->_conn->getWrite()->getEntry($object->getGuid(), array_keys($data));
         $this->_conn->getWrite()->modify($entry, $changes->getChangeset());
     } catch (Horde_Ldap_Exception $e) {
         throw new Horde_Kolab_Server_Exception('Saving failed!', Horde_Kolab_Server_Exception::SYSTEM, $e);
     }
 }
Esempio n. 2
0
 public function testMethodGetchangesetHasResultArrayTheNewValuesAsAddedAndTheRemovedValuesAsDeleted()
 {
     $object = $this->getMock('Horde_Kolab_Server_Object_Interface');
     $object->expects($this->once())->method('readInternal')->will($this->returnValue(array('value' => array('a', 'b', 'c'))));
     $changes = new Horde_Kolab_Server_Ldap_Changes($object, array('value' => array('b', 'c', 'd')));
     $this->assertEquals(array('add' => array('value' => array('d')), 'delete' => array('value' => array('a'))), $changes->getChangeset());
 }