/** * Add new object data. * * @param string $guid The GUID of the object to be added. * @param array $data The attributes of the object to be added. * * @return NULL * * @throws Horde_Kolab_Server_Exception */ public function add(Horde_Kolab_Server_Object_Interface $object, array $data) { //@todo: This will not work this way as we need to map internal // attributes. $this->mapAttributes($data); $this->_server->add($object, $data); }
/** * Add new object data. * * @param Horde_Kolab_Server_Object $object The object to be added. * @param array $data The attributes of the object * to be added. * * @return NULL * * @throws Horde_Kolab_Server_Exception */ public function add(Horde_Kolab_Server_Object_Interface $object, array $data) { try { $this->_server->add($object, $data); $this->_logger->debug(sprintf("The object \"%s\" has been successfully added!", $object->getGuid())); } catch (Horde_Kolab_Server_Exception $e) { $this->_logger->warn(sprintf("Failed adding object \"%s\"! Error: %s", $object->getGuid(), $e->getMessage())); } }
/** * Add new object data. * * @param Horde_Kolab_Server_Object $object The object to be added. * @param array $data The attributes of the object * to be added. * * @return NULL * * @throws Horde_Kolab_Server_Exception */ public function add(Horde_Kolab_Server_Object_Interface $object, array $data) { $this->_server->add($object, $data); if (!isset($this->_count['add'])) { $this->_count['add'] = 1; } else { $this->_count['add']++; } }
/** * Add new object data. * * @param Horde_Kolab_Server_Object $object The object to be added. * @param array $data The attributes of the object * to be added. * * @return NULL * * @throws Horde_Kolab_Server_Exception */ public function add(Horde_Kolab_Server_Object_Interface $object, array $data) { $this->_server->add($object, $data); $this->_added[] = $object->getGuid(); }
/** * Assert that creating a new object operation yields some predictable * attribute results. * * @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 assertAdd(Horde_Kolab_Server $server, array $store, array $fetch) { $object = $server->add($store); $this->assertNoError($object); $this->added[] = array($server, $object->getUid()); $object = $server->fetch($object->getUid()); foreach ($fetch as $attribute => $expect) { $this->assertEquals($expect, $object->get($attribute)); } return $object; }