26 if (!Loader::includeModule(self::$moduleId))
37 if (empty($queueOption))
43 $executiveUserId = ($queueOption[
"executiveUserId"] ?? 0);
44 $groupId = ($queueOption[
"groupId"] ?? 0);
45 $copiedGroupId = ($queueOption[
"copiedGroupId"] ?? 0);
46 $errorOffset = ($queueOption[
"errorOffset"] ?? 0);
49 $offset = $this->getOffset($copiedGroupId) + $errorOffset;
51 $blogPostIds = $this->getBlogPostIdsByGroupId($groupId);
52 $count = count($blogPostIds);
53 $blogPostIds = array_slice($blogPostIds, $offset, $limit);
54 $features = ($queueOption[
"features"] ?: []);
58 $option[
"count"] = $count;
61 $copyManager->setChangedRights([
62 "SG" => [$groupId => $copiedGroupId]
65 $featuresToBlogPost = [];
66 if (in_array(
"comments", $features))
68 $featuresToBlogPost[] =
"comments";
70 if (in_array(
"voteResult", $features))
72 $featuresToBlogPost[] =
"voteResult";
75 $copyManager->setFeatures($featuresToBlogPost);
77 $result = $copyManager->startCopy();
78 if (!$result->isSuccess())
80 $queueOption[
"errorOffset"] += $this->getErrorOffset($copyManager);
84 $option[
"steps"] = $offset;
94 catch (\Exception $exception)
135 $queueId = (string) current($queue);
136 $this->checkerName = (mb_strpos($this->checkerName, $queueId) ===
false ?
138 $this->baseName = (mb_strpos($this->baseName, $queueId) ===
false ?
140 $this->errorName = (mb_strpos($this->errorName, $queueId) ===
false ?
165 $queueId = current($queue);
166 $currentPos = array_search($queueId, $queue);
167 if ($currentPos !==
false)
169 unset($queue[$currentPos]);
170 Option::set(static::$moduleId, $this->queueName, serialize($queue));