/**
  * @see	\wbb\data\DatabaseObjectList::__construct()
  */
 public function __construct()
 {
     parent::__construct();
     // get object types
     $entryObjectType = NewsEntryModificationLogHandler::getInstance()->getObjectType('de.incendium.cms.news.entry');
     $this->entryObjectTypeID = $entryObjectType->objectTypeID;
 }
 /**
  * Initializes the entry list modification log list.
  * 
  * @param	array<integer>		$entryIDs
  * @param	string			$action
  */
 public function setEntryData(array $entryIDs, $action = '')
 {
     // load object type id
     $objectType = NewsEntryModificationLogHandler::getInstance()->getObjectType('de.incendium.cms.news.entry');
     // add conditions
     $this->getConditionBuilder()->add("objectTypeID = ?", array($objectType->objectTypeID));
     $this->getConditionBuilder()->add("objectID IN (?)", array($entryIDs));
     if (!empty($action)) {
         $this->getConditionBuilder()->add("action = ?", array($action));
     }
 }
 /**
  * @see	\wcf\data\IDeleteAction::delete()
  */
 public function delete()
 {
     if (empty($this->objects)) {
         $this->readObjects();
     }
     // collect data
     $entryIDs = $entyData = $attachmentEntryIDs = $perUserCount = $pollIDs = array();
     foreach ($this->objects as $entry) {
         $entryIDs[] = $entry->entryID;
         $entryData[$entry->entryID] = $entry->userID;
         if ($entry->pollID) {
             $pollIDs[] = $entry->pollID;
         }
         if ($entry->attachments) {
             $attachmentEntryIDs[] = $entry->entryID;
         }
         if (!$entry->isDisabled) {
             if (!isset($perUserCount[$entry->userID])) {
                 $perUserCount[$entry->userID] = 0;
             }
             $perUserCount[$entry->userID]++;
         }
     }
     // remove user activity events
     $this->removeActivityEvents($entryData);
     // remove entries
     foreach ($this->objects as $entry) {
         $entry->delete();
         $this->addEntryData($entry->getDecoratedObject(), 'deleted', LinkHandler::getInstance()->getLink('NewsOverview', array('application' => 'cms')));
         NewsEntryModificationLogHandler::getInstance()->delete($entry->getDecoratedObject());
     }
     if (!empty($entryIDs)) {
         // delete like data
         LikeHandler::getInstance()->removeLikes('de.incendium.cms.like.likeableNews', $entryIDs);
         // delete comments
         CommentHandler::getInstance()->deleteObjects('de.incendium.cms.news.comment', $entryIDs);
         // delete tag to object entries
         TagEngine::getInstance()->deleteObjects('de.incendium.cms.news.entry', $entryIDs);
         // delete entry activity events
         UserActivityEventHandler::getInstance()->removeEvents('de.incendium.cms.news.recentActivityEvent.entry', $entryIDs);
         UserActivityPointHandler::getInstance()->removeEvents('de.incendium.cms.news.activityPointEvent.entry', $perUserCount);
         // delete entry from search index
         SearchIndexManager::getInstance()->delete('de.incendium.cms.news.entry', $entryIDs);
         // remove object from moderation queue
         ModerationQueueActivationManager::getInstance()->removeModeratedContent('de.incendium.cms.news.entry', $entryIDs);
     }
     // delete a poll
     if (!empty($pollIDs)) {
         PollManager::getInstance()->removePolls($pollIDs);
     }
     // delete attachments
     if (!empty($attachmentEntryIDs)) {
         AttachmentHandler::removeAttachments('de.incendium.cms.news.entry', $attachmentEntryIDs);
     }
     // reset the user storage data
     UserStorageHandler::getInstance()->resetAll('cmsUnreadNewsEntries');
     $this->unmarkItems();
     return $this->getEntryData();
 }