BxDolTwigModule::onEventDeleted PHP Method

onEventDeleted() public method

public onEventDeleted ( $iEntryId, $aDataEntry = [] )
    function onEventDeleted($iEntryId, $aDataEntry = array())
    {
        // delete associated tags and categories
        $this->reparseTags($iEntryId);
        $this->reparseCategories($iEntryId);
        // delete votings
        bx_import('Voting', $this->_aModule);
        $sClass = $this->_aModule['class_prefix'] . 'Voting';
        $oVoting = new $sClass($this->_sPrefix, 0, 0);
        $oVoting->deleteVotings($iEntryId);
        // delete comments
        bx_import('Cmts', $this->_aModule);
        $sClass = $this->_aModule['class_prefix'] . 'Cmts';
        $oCmts = new $sClass($this->_sPrefix, $iEntryId);
        $oCmts->onObjectDelete();
        // delete views
        bx_import('BxDolViews');
        $oViews = new BxDolViews($this->_sPrefix, $iEntryId, false);
        $oViews->onObjectDelete();
        // delete forum
        $this->_oDb->deleteForum($iEntryId);
        // delete associated locations
        if (BxDolModule::getInstance('BxWmapModule')) {
            BxDolService::call('wmap', 'response_entry_delete', array($this->_oConfig->getUri(), $iEntryId));
        }
        // delete all subscriptions
        $oSubscription = BxDolSubscription::getInstance();
        $oSubscription->unsubscribe(array('type' => 'object_id', 'unit' => $this->_sPrefix, 'object_id' => $iEntryId));
        // arise alert
        $oAlert = new BxDolAlerts($this->_sPrefix, 'delete', $iEntryId, $this->_iProfileId);
        $oAlert->alert();
    }