12 private $executiveUserId;
13 private $topicIdsToCopy = [];
15 public function __construct($executiveUserId, array $topicIdsToCopy)
17 $this->executiveUserId = $executiveUserId;
18 $this->topicIdsToCopy = $topicIdsToCopy;
23 $containerCollection = $this->getContainerCollection();
25 $topicCopier = $this->getTopicCopier();
27 return $topicCopier->copy($containerCollection);
30 private function getContainerCollection()
34 foreach ($this->topicIdsToCopy as $topicId)
36 $containerCollection[] =
new Container($topicId);
39 return $containerCollection;
42 private function getTopicCopier()
44 return new EntityCopier($this->getTopicImplementer());
47 private function getTopicImplementer()
49 global $USER_FIELD_MANAGER;
51 $commentImplementer =
new CommentImplementer();
52 $commentImplementer->setUserFieldManager($USER_FIELD_MANAGER);
53 $commentImplementer->setExecutiveUserId($this->executiveUserId);
54 $commentCopier =
new EntityCopier($commentImplementer);
56 $topicImplementer =
new TopicImplementer();
57 $topicImplementer->setCommentCopier($commentCopier);
59 return $topicImplementer;