13 private $voteIdsToCopy;
15 private $resetVotingResult =
true;
17 private $markerQuestion =
true;
18 private $markerAnswer =
true;
22 $this->voteIdsToCopy = $voteIdsToCopy;
27 $this->markerQuestion = (bool) $marker;
32 $this->markerAnswer = (bool) $marker;
37 $this->resetVotingResult = $bool;
42 $containerCollection = $this->getContainerCollection();
44 $voteCopier = $this->getVoteCopier();
46 return $voteCopier->copy($containerCollection);
49 private function getContainerCollection()
53 foreach ($this->voteIdsToCopy as $id)
55 $containerCollection[] =
new Container($id);
58 return $containerCollection;
61 private function getVoteCopier()
63 $voteImplementer =
new VoteImplementer();
64 $voteImplementer->setResetVotingResult($this->resetVotingResult);
65 if ($this->markerQuestion)
67 $voteImplementer->setQuestionCopier($this->getQuestionCopier());
69 return new EntityCopier($voteImplementer);
72 private function getQuestionCopier()
74 $questionImplementer =
new QuestionImplementer();
75 $questionImplementer->setResetVotingResult($this->resetVotingResult);
76 if ($this->markerAnswer)
78 $questionImplementer->setAnswerCopier($this->getAnswerCopier());
81 return new EntityCopier($questionImplementer);
84 private function getAnswerCopier()
86 $answerImplementer =
new AnswerImplementer();
87 $answerImplementer->setResetVotingResult($this->resetVotingResult);
88 return new EntityCopier($answerImplementer);