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