示例#1
0
文件: Mcached.php 项目: horde/horde
 /**
  * Saves object information. This may either create a new entry or modify an
  * existing entry.
  *
  * Please note that fields with multiple allowed values require the callee
  * to provide the full set of values for the field. Any old values that are
  * not resubmitted will be considered to be deleted.
  *
  * @param array $info The information about the object.
  *
  * @return NULL
  *
  * @throws Horde_Kolab_Server_Exception If saving the data failed.
  */
 public function save(array $info)
 {
     $this->_object->save($info);
     /** Mark the object as existing */
     $this->_exists = true;
     /**
      * Throw away the cache data to ensure it gets refetched in case we need
      * to access it again
      */
     $this->_cache_ext = array();
     $this->_cache_int = array();
 }
示例#2
0
文件: Hash.php 项目: horde/horde
 /**
  * Saves object information. This may either create a new entry or modify an
  * existing entry.
  *
  * Please note that fields with multiple allowed values require the callee
  * to provide the full set of values for the field. Any old values that are
  * not resubmitted will be considered to be deleted.
  *
  * @param array $info The information about the object.
  *
  * @return NULL
  *
  * @throws Horde_Kolab_Server_Exception If saving the data failed.
  */
 public function save(array $info)
 {
     $this->_object->save($info);
 }
示例#3
0
文件: Scenario.php 项目: horde/horde
 /**
  * Assert that a save() operation yields some predictable attribute results.
  *
  * @param Horde_Kolab_Server_Object  $object The object to work on.
  * @param Horde_Kolab_Server         $server The server the object resides on.
  * @param array                      $store  The information to save.
  * @param array                      $fetch  The expected results.
  *
  * @return NULL.
  */
 protected function assertStoreFetch(Horde_Kolab_Server_Object $object, Horde_Kolab_Server $server, array $store, array $fetch, $pop_arrays = false)
 {
     $result = $object->save($store);
     $this->assertNoError($result);
     $object = $server->fetch($object->getUid());
     foreach ($fetch as $attribute => $expect) {
         $actual = $object->get($attribute, false);
         if ($pop_arrays && is_array($actual) && count($actual) == 1) {
             $actual = array_pop($actual);
         }
         $this->assertEquals($expect, $actual);
     }
 }