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