/** * @param string $action * * @return mixed * @throws \ACP3\Core\Controller\Exception\ResultNotExistsException */ public function execute($action = '') { return $this->actionHelper->handleDeleteAction($action, function (array $items) { $bool = false; foreach ($items as $item) { $bool = $this->commentRepository->delete($item, 'module_id'); } Core\Cache\Purge::doPurge($this->appPath->getCacheDir() . 'http'); return $bool; }); }
/** * @param int $moduleId * @param int $resultId * * @return int */ public function deleteCommentsByModuleAndResult($moduleId, $resultId) { return $this->commentRepository->delete(['module_id' => $moduleId, 'entry_id' => $resultId]); }