aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Event/Activity/Actions/Federation
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Event/Activity/Actions/Federation')
-rw-r--r--src/Wallabag/CoreBundle/Event/Activity/Actions/Federation/FederationEvent.php40
-rw-r--r--src/Wallabag/CoreBundle/Event/Activity/Actions/Federation/FollowEvent.php39
-rw-r--r--src/Wallabag/CoreBundle/Event/Activity/Actions/Federation/RecommendedEntryEvent.php43
-rw-r--r--src/Wallabag/CoreBundle/Event/Activity/Actions/Federation/UnfollowEvent.php39
4 files changed, 161 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Event/Activity/Actions/Federation/FederationEvent.php b/src/Wallabag/CoreBundle/Event/Activity/Actions/Federation/FederationEvent.php
new file mode 100644
index 00000000..da18330e
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Event/Activity/Actions/Federation/FederationEvent.php
@@ -0,0 +1,40 @@
1<?php
2
3namespace Wallabag\CoreBundle\Event\Activity\Actions\Federation;
4
5use Symfony\Component\EventDispatcher\Event;
6use Wallabag\FederationBundle\Entity\Account;
7
8abstract class FederationEvent extends Event
9{
10 protected $account;
11
12 /**
13 * FederationEvent constructor.
14 * @param Account $account
15 */
16 public function __construct(Account $account)
17 {
18 $this->account = $account;
19 }
20
21 /**
22 * @return Account
23 */
24 public function getAccount()
25 {
26 return $this->account;
27 }
28
29 /**
30 * @param Account $account
31 * @return FederationEvent
32 */
33 public function setAccount(Account $account)
34 {
35 $this->account = $account;
36 return $this;
37 }
38
39
40}
diff --git a/src/Wallabag/CoreBundle/Event/Activity/Actions/Federation/FollowEvent.php b/src/Wallabag/CoreBundle/Event/Activity/Actions/Federation/FollowEvent.php
new file mode 100644
index 00000000..4004932e
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Event/Activity/Actions/Federation/FollowEvent.php
@@ -0,0 +1,39 @@
1<?php
2
3namespace Wallabag\CoreBundle\Event\Activity\Actions\Federation;
4
5use Wallabag\FederationBundle\Entity\Account;
6
7/**
8 * This event is fired as soon as an account was followed.
9 */
10class FollowEvent extends FederationEvent
11{
12 const NAME = 'federation.follow';
13
14 protected $follower;
15
16 public function __construct(Account $accountFollowed, Account $follower)
17 {
18 parent::__construct($accountFollowed);
19 $this->follower = $follower;
20 }
21
22 /**
23 * @return Account
24 */
25 public function getFollower()
26 {
27 return $this->follower;
28 }
29
30 /**
31 * @param Account $follower
32 * @return FollowEvent
33 */
34 public function setFollower(Account $follower)
35 {
36 $this->follower = $follower;
37 return $this;
38 }
39}
diff --git a/src/Wallabag/CoreBundle/Event/Activity/Actions/Federation/RecommendedEntryEvent.php b/src/Wallabag/CoreBundle/Event/Activity/Actions/Federation/RecommendedEntryEvent.php
new file mode 100644
index 00000000..998b56d5
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Event/Activity/Actions/Federation/RecommendedEntryEvent.php
@@ -0,0 +1,43 @@
1<?php
2
3namespace Wallabag\CoreBundle\Event\Activity\Actions\Federation;
4
5use Symfony\Component\EventDispatcher\Event;
6use Wallabag\CoreBundle\Entity\Entry;
7
8/**
9 * This event is fired as soon as an entry was recommended.
10 */
11class RecommendedEntryEvent extends Event
12{
13 const NAME = 'federation.recommend';
14
15 protected $entry;
16
17 /**
18 * FederationEvent constructor.
19 * @param Entry $entry
20 */
21 public function __construct(Entry $entry)
22 {
23 $this->entry = $entry;
24 }
25
26 /**
27 * @return Entry
28 */
29 public function getEntry()
30 {
31 return $this->entry;
32 }
33
34 /**
35 * @param Entry $entry
36 * @return RecommendedEntryEvent
37 */
38 public function setEntry(Entry $entry)
39 {
40 $this->entry = $entry;
41 return $this;
42 }
43}
diff --git a/src/Wallabag/CoreBundle/Event/Activity/Actions/Federation/UnfollowEvent.php b/src/Wallabag/CoreBundle/Event/Activity/Actions/Federation/UnfollowEvent.php
new file mode 100644
index 00000000..bf9a35f8
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Event/Activity/Actions/Federation/UnfollowEvent.php
@@ -0,0 +1,39 @@
1<?php
2
3namespace Wallabag\CoreBundle\Event\Activity\Actions\Federation;
4
5use Wallabag\FederationBundle\Entity\Account;
6
7/**
8 * This event is fired as soon as an account is being unfollowed
9 */
10class UnfollowEvent extends FederationEvent
11{
12 const NAME = 'federation.unfollow';
13
14 protected $follower;
15
16 public function __construct(Account $accountFollowed, Account $follower)
17 {
18 parent::__construct($accountFollowed);
19 $this->follower = $follower;
20 }
21
22 /**
23 * @return Account
24 */
25 public function getFollower()
26 {
27 return $this->follower;
28 }
29
30 /**
31 * @param Account $follower
32 * @return UnfollowEvent
33 */
34 public function setFollower(Account $follower)
35 {
36 $this->follower = $follower;
37 return $this;
38 }
39}