@@ 630-649 (lines=20) @@ | ||
627 | return true; |
|
628 | } |
|
629 | ||
630 | public function addView($user, $ipAddress, $post) |
|
631 | { |
|
632 | $postvoteViewMapper = $this->getPostVoteViewMapper(); |
|
633 | $postView = new \PlaygroundGame\Entity\PostVoteView(); |
|
634 | $postView->setPost($post) |
|
635 | ->setPostvote($post->getPostvote()) |
|
636 | ->setUser($user) |
|
637 | ->setIp($ipAddress); |
|
638 | $postvoteViewMapper->insert($postView); |
|
639 | ||
640 | $this->getEventManager()->trigger( |
|
641 | __FUNCTION__ . '.post', |
|
642 | $this, |
|
643 | array( |
|
644 | 'post' => $post |
|
645 | ) |
|
646 | ); |
|
647 | ||
648 | return true; |
|
649 | } |
|
650 | ||
651 | public function addShare($post, $user) |
|
652 | { |
|
@@ 651-670 (lines=20) @@ | ||
648 | return true; |
|
649 | } |
|
650 | ||
651 | public function addShare($post, $user) |
|
652 | { |
|
653 | $postvoteShareMapper = $this->getPostVoteShareMapper(); |
|
654 | $postShare = new \PlaygroundGame\Entity\PostVoteShare(); |
|
655 | $postShare->setPost($post) |
|
656 | ->setPostvote($post->getPostvote()) |
|
657 | ->setUser($user) |
|
658 | ->setOrigin('mail'); |
|
659 | $postvoteShareMapper->insert($postShare); |
|
660 | ||
661 | $this->getEventManager()->trigger( |
|
662 | __FUNCTION__ . '.post', |
|
663 | $this, |
|
664 | array( |
|
665 | 'post' => $post |
|
666 | ) |
|
667 | ); |
|
668 | ||
669 | return true; |
|
670 | } |
|
671 | ||
672 | /** |
|
673 | * Get all comments for this game |