13 private $executiveUserId;
14 private $blogPostIdsToCopy = [];
16 private $features = [];
17 private $changedRights = [];
20 private $mapIdsCopiedPosts = [];
22 public function __construct($executiveUserId, array $blogPostIdsToCopy)
24 $this->executiveUserId = $executiveUserId;
25 $this->blogPostIdsToCopy = $blogPostIdsToCopy;
27 $this->result =
new Result();
37 $this->features = array_filter($features);
42 $this->changedRights = $changedRights;
47 $containerCollection = $this->getContainerCollection();
49 $blogPostImplementer = $this->getBlogPostImplementer();
50 $blogPostCopier = $this->getBlogPostCopier($blogPostImplementer);
52 $this->result = $blogPostCopier->copy($containerCollection);
53 $this->mapIdsCopiedPosts = $blogPostCopier->getMapIdsCopiedEntity();
60 return $this->mapIdsCopiedPosts;
63 private function getContainerCollection()
67 foreach ($this->blogPostIdsToCopy as $blogPostId)
69 $containerCollection[] =
new Container($blogPostId);
72 return $containerCollection;
75 private function getBlogPostCopier(BlogPostImplementer $blogPostImplementer)
77 return new EntityCopier($blogPostImplementer);
80 private function getBlogPostImplementer()
82 global $USER_FIELD_MANAGER;
84 $blogPostImplementer =
new BlogPostImplementer();
86 $blogPostImplementer->setBlogCommentCopier($this->getBlogCommentCopier());
87 $blogPostImplementer->setUserFieldManager($USER_FIELD_MANAGER);
88 $blogPostImplementer->setFeatures($this->features);
89 $blogPostImplementer->setChangedRights($this->changedRights);
90 $blogPostImplementer->setExecutiveUserId($this->executiveUserId);
92 return $blogPostImplementer;
95 private function getBlogCommentCopier()
97 global $USER_FIELD_MANAGER;
99 $blogCommentImplementer =
new BlogCommentImplementer();
101 $blogCommentImplementer->setUserFieldManager($USER_FIELD_MANAGER);
102 $blogCommentImplementer->setExecutiveUserId($this->executiveUserId);
104 return new EntityCopier($blogCommentImplementer);
setChangedRights($changedRights)
__construct($executiveUserId, array $blogPostIdsToCopy)
setFeatures(array $features)