Turba_Driver::save PHP Method

save() public method

Modifies an existing entry in the contact source.
public save ( Turba_Object $object ) : string
$object Turba_Object The object to update.
return string The object id, possibly updated.
    public function save(Turba_Object $object)
    {
        $object_id = $this->_save($object);
        if ($uid = $object->getValue('__uid')) {
            /* Update tags. */
            if (!is_null($tags = $object->getValue('__tags'))) {
                $GLOBALS['injector']->getInstance('Turba_Tagger')->replaceTags($uid, $tags, $this->getContactOwner(), 'contact');
            }
            /* Log the modification of this item in the history log. */
            try {
                $GLOBALS['injector']->getInstance('Horde_History')->log($object->getGuid(), array('action' => 'modify'), true);
            } catch (Exception $e) {
                Horde::log($e, 'ERR');
            }
        }
        return $object_id;
    }

Usage Example

Example #1
0
 /**
  * @see Turba_Driver::_save
  */
 protected function _save(Turba_Object $object)
 {
     return $this->_driver->save($object);
 }
All Usage Examples Of Turba_Driver::save