Horde_Kolab_Storage_Data_Base::delete PHP Method

delete() public method

Delete the specified objects from this data set.
public delete ( array | string $object_ids )
$object_ids array | string Id(s) of the object to be deleted.
    public function delete($object_ids)
    {
        // Short circuit empty collections.
        if (empty($object_ids)) {
            return;
        }
        if (!is_array($object_ids)) {
            $object_ids = array($object_ids);
        }
        $uids = array();
        foreach ($object_ids as $id) {
            if ($this->objectIdExists($id)) {
                $uids[$this->getBackendId($id)] = $id;
            } else {
                throw new Horde_Kolab_Storage_Exception(sprintf('No such object %s!', $id));
            }
        }
        $this->deleteBackendIds(array_keys($uids));
        $this->synchronize(array('changes' => array(Horde_Kolab_Storage_Folder_Stamp::ADDED => array(), Horde_Kolab_Storage_Folder_Stamp::DELETED => $uids)));
    }