Kronolith_Driver::_addTags PHP Method

_addTags() protected method

Helper function to add tags from a newly creted event to the tagger.
protected _addTags ( Kronolith_Event $event )
$event Kronolith_Event The event to save tags to storage for.
    protected function _addTags(Kronolith_Event $event)
    {
        $tagger = Kronolith::getTagger();
        $tagger->tag($event->uid, $event->tags, $event->creator, Kronolith_Tagger::TYPE_EVENT);
        // Resources don't currently have owners, so can't tag as owner.
        if ($event->calendarType == 'resource') {
            return;
        }
        // Add tags again, but as the share owner.
        try {
            $cal = $GLOBALS['injector']->getInstance('Kronolith_Shares')->getShare($event->calendar);
        } catch (Horde_Share_Exception $e) {
            Horde::log($e->getMessage(), 'ERR');
            throw new Kronolith_Exception($e);
        }
        if ($cal->get('owner') != $event->creator) {
            $tagger->tag($event->uid, $event->tags, $cal->get('owner'), 'event');
        }
    }