<commit_before><?php
namespace wcf\data\article\content;
use wcf\data\AbstractDatabaseObjectAction;
use wcf\system\comment\CommentHandler;
use wcf\system\search\SearchIndexManager;
use wcf\system\tagging\TagEngine;

/**
 * Executes article content related actions.
 * 
 * @author	<NAME>
 * @copyright	2001-2018 WoltLab GmbH
 * @license	GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
 * @package	WoltLabSuite\Core\Data\Article\Content
 * @since	3.0
 * 
 * @method	ArticleContentEditor[]	getObjects()
 * @method	ArticleContentEditor	getSingleObject()
 */
class ArticleContentAction extends AbstractDatabaseObjectAction {
	/**
	 * @inheritDoc
	 */
	protected $className = ArticleContentEditor::class;
	
	/**
	 * @inheritDoc
	 */
	public function delete() {
		$articleContentIDs = [];
		foreach ($this->getObjects() as $contentEditor) {
			$articleContentIDs[] = $contentEditor->getDecoratedObject()->articleContentID;
		}
		
		// delete comments
		CommentHandler::getInstance()->deleteObjects('com.woltlab.wcf.articleComment', $articleContentIDs);
		// delete tag to object entries
		TagEngine::getInstance()->deleteObjects('com.woltlab.wcf.article', $articleContentIDs);
		// delete entry from search index
		SearchIndexManager::getInstance()->delete('com.woltlab.wcf.article', $articleContentIDs);
	}
}<commit_msg>Missing removal of orphaned article content<commit_after><?php
namespace wcf\data\article\content;
use wcf\data\AbstractDatabaseObjectAction;
use wcf\system\comment\CommentHandler;
use wcf\system\search\SearchIndexManager;
use wcf\system\tagging\TagEngine;

/**
 * Executes article content related actions.
 * 
 * @author	<NAME>
 * @copyright	2001-2018 WoltLab GmbH
 * @license	GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
 * @package	WoltLabSuite\Core\Data\Article\Content
 * @since	3.0
 * 
 * @method	ArticleContentEditor[]	getObjects()
 * @method	ArticleContentEditor	getSingleObject()
 */
class ArticleContentAction extends AbstractDatabaseObjectAction {
	/**
	 * @inheritDoc
	 */
	protected $className = ArticleContentEditor::class;
	
	/**
	 * @inheritDoc
	 */
	public function delete() {
		$articleContentIDs = [];
		foreach ($this->getObjects() as $contentEditor) {
			$articleContentIDs[] = $contentEditor->getDecoratedObject()->articleContentID;
		}
		
		// delete comments
		CommentHandler::getInstance()->deleteObjects('com.woltlab.wcf.articleComment', $articleContentIDs);
		// delete tag to object entries
		TagEngine::getInstance()->deleteObjects('com.woltlab.wcf.article', $articleContentIDs);
		// delete entry from search index
		SearchIndexManager::getInstance()->delete('com.woltlab.wcf.article', $articleContentIDs);
		
		parent::delete();
	}
}
{'fraction_non_alphanumeric': 0.13040319651289503, 'fraction_numerical': 0.00726480203414457, 'mean_word_length': 5.259090909090909, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3526173', 'n_tokens_mistral': 868, 'n_tokens_neox': 791, 'n_words': 158}