aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Event/Activity/Actions
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Event/Activity/Actions')
-rw-r--r--src/Wallabag/CoreBundle/Event/Activity/Actions/Annotation/AnnotationCreatedEvent.php8
-rw-r--r--src/Wallabag/CoreBundle/Event/Activity/Actions/Annotation/AnnotationDeletedEvent.php8
-rw-r--r--src/Wallabag/CoreBundle/Event/Activity/Actions/Annotation/AnnotationEditedEvent.php8
-rw-r--r--src/Wallabag/CoreBundle/Event/Activity/Actions/Annotation/AnnotationEvent.php39
-rw-r--r--src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryDeletedEvent.php11
-rw-r--r--src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryEditedEvent.php11
-rw-r--r--src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryEvent.php41
-rw-r--r--src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryFavouriteEvent.php14
-rw-r--r--src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryReadEvent.php14
-rw-r--r--src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntrySavedEvent.php11
-rw-r--r--src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryTaggedEvent.php55
-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
-rw-r--r--src/Wallabag/CoreBundle/Event/Activity/Actions/Share/ShareAcceptedEvent.php11
-rw-r--r--src/Wallabag/CoreBundle/Event/Activity/Actions/Share/ShareCancelledEvent.php11
-rw-r--r--src/Wallabag/CoreBundle/Event/Activity/Actions/Share/ShareCreatedEvent.php11
-rw-r--r--src/Wallabag/CoreBundle/Event/Activity/Actions/Share/ShareDeniedEvent.php11
-rw-r--r--src/Wallabag/CoreBundle/Event/Activity/Actions/Share/ShareEvent.php39
-rw-r--r--src/Wallabag/CoreBundle/Event/Activity/Actions/User/UserDeletedEvent.php8
-rw-r--r--src/Wallabag/CoreBundle/Event/Activity/Actions/User/UserEditedEvent.php8
-rw-r--r--src/Wallabag/CoreBundle/Event/Activity/Actions/User/UserEvent.php41
23 files changed, 521 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Event/Activity/Actions/Annotation/AnnotationCreatedEvent.php b/src/Wallabag/CoreBundle/Event/Activity/Actions/Annotation/AnnotationCreatedEvent.php
new file mode 100644
index 00000000..b3667703
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Event/Activity/Actions/Annotation/AnnotationCreatedEvent.php
@@ -0,0 +1,8 @@
1<?php
2
3namespace Wallabag\CoreBundle\Event\Activity\Actions\Annotation;
4
5class AnnotationCreatedEvent extends AnnotationEvent
6{
7 const NAME = 'annotation.created';
8}
diff --git a/src/Wallabag/CoreBundle/Event/Activity/Actions/Annotation/AnnotationDeletedEvent.php b/src/Wallabag/CoreBundle/Event/Activity/Actions/Annotation/AnnotationDeletedEvent.php
new file mode 100644
index 00000000..60d53849
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Event/Activity/Actions/Annotation/AnnotationDeletedEvent.php
@@ -0,0 +1,8 @@
1<?php
2
3namespace Wallabag\CoreBundle\Event\Activity\Actions\Annotation;
4
5class AnnotationDeletedEvent extends AnnotationEvent
6{
7 const NAME = 'annotation.deleted';
8}
diff --git a/src/Wallabag/CoreBundle/Event/Activity/Actions/Annotation/AnnotationEditedEvent.php b/src/Wallabag/CoreBundle/Event/Activity/Actions/Annotation/AnnotationEditedEvent.php
new file mode 100644
index 00000000..385b8025
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Event/Activity/Actions/Annotation/AnnotationEditedEvent.php
@@ -0,0 +1,8 @@
1<?php
2
3namespace Wallabag\CoreBundle\Event\Activity\Actions\Annotation;
4
5class AnnotationEditedEvent extends AnnotationEvent
6{
7 const NAME = 'annotation.edited';
8}
diff --git a/src/Wallabag/CoreBundle/Event/Activity/Actions/Annotation/AnnotationEvent.php b/src/Wallabag/CoreBundle/Event/Activity/Actions/Annotation/AnnotationEvent.php
new file mode 100644
index 00000000..b4cb93af
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Event/Activity/Actions/Annotation/AnnotationEvent.php
@@ -0,0 +1,39 @@
1<?php
2
3namespace Wallabag\CoreBundle\Event\Activity\Actions\Annotation;
4
5use Symfony\Component\EventDispatcher\Event;
6use Wallabag\AnnotationBundle\Entity\Annotation;
7
8/**
9 * This event is fired when annotation-relative stuff is made.
10 */
11abstract class AnnotationEvent extends Event
12{
13 protected $annotation;
14
15 /**
16 * AnnotationEvent constructor.
17 * @param Annotation $annotation
18 */
19 public function __construct(Annotation $annotation)
20 {
21 $this->annotation = $annotation;
22 }
23
24 /**
25 * @return Annotation
26 */
27 public function getAnnotation()
28 {
29 return $this->annotation;
30 }
31
32 /**
33 * @param Annotation $annotation
34 */
35 public function setAnnotation(Annotation $annotation)
36 {
37 $this->annotation = $annotation;
38 }
39}
diff --git a/src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryDeletedEvent.php b/src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryDeletedEvent.php
new file mode 100644
index 00000000..1d413d41
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryDeletedEvent.php
@@ -0,0 +1,11 @@
1<?php
2
3namespace Wallabag\CoreBundle\Event\Activity\Actions\Entry;
4
5/**
6 * This event is fired as soon as an entry is deleted.
7 */
8class EntryDeletedEvent extends EntryEvent
9{
10 const NAME = 'entry.deleted';
11}
diff --git a/src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryEditedEvent.php b/src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryEditedEvent.php
new file mode 100644
index 00000000..f7528bb4
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryEditedEvent.php
@@ -0,0 +1,11 @@
1<?php
2
3namespace Wallabag\CoreBundle\Event\Activity\Actions\Entry;
4
5/**
6 * This event is fired as soon as an entry was edited.
7 */
8class EntryEditedEvent extends EntryEvent
9{
10 const NAME = 'entry.edited';
11}
diff --git a/src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryEvent.php b/src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryEvent.php
new file mode 100644
index 00000000..0e0c90d0
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryEvent.php
@@ -0,0 +1,41 @@
1<?php
2
3namespace Wallabag\CoreBundle\Event\Activity\Actions\Entry;
4
5use Symfony\Component\EventDispatcher\Event;
6use Wallabag\CoreBundle\Entity\Entry;
7
8/**
9 * This event is fired when entry-related stuff is made.
10 */
11abstract class EntryEvent extends Event
12{
13 protected $entry;
14
15 /**
16 * EntryEvent constructor.
17 * @param Entry $entry
18 */
19 public function __construct(Entry $entry)
20 {
21 $this->entry = $entry;
22 }
23
24 /**
25 * @return Entry
26 */
27 public function getEntry()
28 {
29 return $this->entry;
30 }
31
32 /**
33 * @param Entry $entry
34 * @return EntryEvent
35 */
36 public function setEntry(Entry $entry)
37 {
38 $this->entry = $entry;
39 return $this;
40 }
41}
diff --git a/src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryFavouriteEvent.php b/src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryFavouriteEvent.php
new file mode 100644
index 00000000..98edb00d
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryFavouriteEvent.php
@@ -0,0 +1,14 @@
1<?php
2
3namespace Wallabag\CoreBundle\Event\Activity\Actions\Entry;
4
5use Symfony\Component\EventDispatcher\Event;
6use Wallabag\CoreBundle\Entity\Entry;
7
8/**
9 * This event is fired as soon as an entry was favourited.
10 */
11class EntryFavouriteEvent extends EntryEvent
12{
13 const NAME = 'entry.favourite';
14}
diff --git a/src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryReadEvent.php b/src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryReadEvent.php
new file mode 100644
index 00000000..be6e6b40
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryReadEvent.php
@@ -0,0 +1,14 @@
1<?php
2
3namespace Wallabag\CoreBundle\Event\Activity\Actions\Entry;
4
5use Symfony\Component\EventDispatcher\Event;
6use Wallabag\CoreBundle\Entity\Entry;
7
8/**
9 * This event is fired as soon as an entry was favourited.
10 */
11class EntryReadEvent extends EntryEvent
12{
13 const NAME = 'entry.read';
14}
diff --git a/src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntrySavedEvent.php b/src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntrySavedEvent.php
new file mode 100644
index 00000000..20c623c5
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntrySavedEvent.php
@@ -0,0 +1,11 @@
1<?php
2
3namespace Wallabag\CoreBundle\Event\Activity\Actions\Entry;
4
5/**
6 * This event is fired as soon as an entry was saved.
7 */
8class EntrySavedEvent extends EntryEvent
9{
10 const NAME = 'entry.saved';
11}
diff --git a/src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryTaggedEvent.php b/src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryTaggedEvent.php
new file mode 100644
index 00000000..1ea8a7f1
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Event/Activity/Actions/Entry/EntryTaggedEvent.php
@@ -0,0 +1,55 @@
1<?php
2
3namespace Wallabag\CoreBundle\Event\Activity\Actions\Entry;
4
5use Wallabag\CoreBundle\Entity\Entry;
6use Wallabag\CoreBundle\Entity\Tag;
7
8/**
9 * This event is fired as soon as a tag is added on an entry.
10 */
11class EntryTaggedEvent extends EntryEvent
12{
13 const NAME = 'entry.tagged';
14
15 /** @var Tag[] */
16 protected $tags;
17
18 /**
19 * @var boolean
20 */
21 protected $remove;
22
23 /**
24 * EntryTaggedEvent constructor.
25 * @param Entry $entry
26 * @param $tags
27 * @param bool $remove
28 */
29 public function __construct(Entry $entry, $tags, $remove = false)
30 {
31 parent::__construct($entry);
32
33 if (false === is_array($tags)) {
34 $tags = [$tags];
35 }
36
37 $this->tags = $tags;
38 }
39
40 /**
41 * @return Tag[]
42 */
43 public function getTags()
44 {
45 return $this->tags;
46 }
47
48 /**
49 * @return bool
50 */
51 public function isRemove()
52 {
53 return $this->remove;
54 }
55}
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}
diff --git a/src/Wallabag/CoreBundle/Event/Activity/Actions/Share/ShareAcceptedEvent.php b/src/Wallabag/CoreBundle/Event/Activity/Actions/Share/ShareAcceptedEvent.php
new file mode 100644
index 00000000..e171ef04
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Event/Activity/Actions/Share/ShareAcceptedEvent.php
@@ -0,0 +1,11 @@
1<?php
2
3namespace Wallabag\CoreBundle\Event\Activity\Actions\Share;
4
5/**
6 * This event is fired as soon as an share is accepted
7 */
8class ShareAcceptedEvent extends ShareEvent
9{
10 const NAME = 'share.accepted';
11}
diff --git a/src/Wallabag/CoreBundle/Event/Activity/Actions/Share/ShareCancelledEvent.php b/src/Wallabag/CoreBundle/Event/Activity/Actions/Share/ShareCancelledEvent.php
new file mode 100644
index 00000000..26bee896
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Event/Activity/Actions/Share/ShareCancelledEvent.php
@@ -0,0 +1,11 @@
1<?php
2
3namespace Wallabag\CoreBundle\Event\Activity\Actions\Share;
4
5/**
6 * This event is fired as soon as an share is cancelled
7 */
8class ShareCancelledEvent extends ShareEvent
9{
10 const NAME = 'share.cancelled';
11}
diff --git a/src/Wallabag/CoreBundle/Event/Activity/Actions/Share/ShareCreatedEvent.php b/src/Wallabag/CoreBundle/Event/Activity/Actions/Share/ShareCreatedEvent.php
new file mode 100644
index 00000000..c2cb72d8
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Event/Activity/Actions/Share/ShareCreatedEvent.php
@@ -0,0 +1,11 @@
1<?php
2
3namespace Wallabag\CoreBundle\Event\Activity\Actions\Share;
4
5/**
6 * This event is fired as soon as a share is created.
7 */
8class ShareCreatedEvent extends ShareEvent
9{
10 const NAME = 'share.created';
11}
diff --git a/src/Wallabag/CoreBundle/Event/Activity/Actions/Share/ShareDeniedEvent.php b/src/Wallabag/CoreBundle/Event/Activity/Actions/Share/ShareDeniedEvent.php
new file mode 100644
index 00000000..fcdfd1ce
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Event/Activity/Actions/Share/ShareDeniedEvent.php
@@ -0,0 +1,11 @@
1<?php
2
3namespace Wallabag\CoreBundle\Event\Activity\Actions\Share;
4
5/**
6 * This event is fired as soon as an share is denied
7 */
8class ShareDeniedEvent extends ShareEvent
9{
10 const NAME = 'share.denied';
11}
diff --git a/src/Wallabag/CoreBundle/Event/Activity/Actions/Share/ShareEvent.php b/src/Wallabag/CoreBundle/Event/Activity/Actions/Share/ShareEvent.php
new file mode 100644
index 00000000..0022a39f
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Event/Activity/Actions/Share/ShareEvent.php
@@ -0,0 +1,39 @@
1<?php
2
3namespace Wallabag\CoreBundle\Event\Activity\Actions\Share;
4
5use Symfony\Component\EventDispatcher\Event;
6use Wallabag\CoreBundle\Entity\Share;
7
8/**
9 * This event is fired when share-related stuff is made.
10 */
11abstract class ShareEvent extends Event
12{
13 protected $share;
14
15 /**
16 * ShareEvent constructor.
17 * @param Share $share
18 */
19 public function __construct(Share $share)
20 {
21 $this->share = $share;
22 }
23
24 /**
25 * @return Share
26 */
27 public function getShare()
28 {
29 return $this->share;
30 }
31
32 /**
33 * @param Share $share
34 */
35 public function setShare(Share $share)
36 {
37 $this->share = $share;
38 }
39}
diff --git a/src/Wallabag/CoreBundle/Event/Activity/Actions/User/UserDeletedEvent.php b/src/Wallabag/CoreBundle/Event/Activity/Actions/User/UserDeletedEvent.php
new file mode 100644
index 00000000..df06db8c
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Event/Activity/Actions/User/UserDeletedEvent.php
@@ -0,0 +1,8 @@
1<?php
2
3namespace Wallabag\CoreBundle\Event\Activity\Actions\User;
4
5class UserDeletedEvent extends UserEvent
6{
7 const NAME = 'user.deleted';
8}
diff --git a/src/Wallabag/CoreBundle/Event/Activity/Actions/User/UserEditedEvent.php b/src/Wallabag/CoreBundle/Event/Activity/Actions/User/UserEditedEvent.php
new file mode 100644
index 00000000..27f8f2d5
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Event/Activity/Actions/User/UserEditedEvent.php
@@ -0,0 +1,8 @@
1<?php
2
3namespace Wallabag\CoreBundle\Event\Activity\Actions\User;
4
5class UserEditedEvent extends UserEvent
6{
7 const NAME = 'user.edited';
8}
diff --git a/src/Wallabag/CoreBundle/Event/Activity/Actions/User/UserEvent.php b/src/Wallabag/CoreBundle/Event/Activity/Actions/User/UserEvent.php
new file mode 100644
index 00000000..e3807abf
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Event/Activity/Actions/User/UserEvent.php
@@ -0,0 +1,41 @@
1<?php
2
3namespace Wallabag\CoreBundle\Event\Activity\Actions\User;
4
5use Symfony\Component\EventDispatcher\Event;
6use Wallabag\UserBundle\Entity\User;
7
8/**
9 * This event is fired when user-related stuff is made.
10 */
11abstract class UserEvent extends Event
12{
13 protected $user;
14
15 /**
16 * UserEvent constructor.
17 * @param User $user
18 */
19 public function __construct(User $user)
20 {
21 $this->user = $user;
22 }
23
24 /**
25 * @return User
26 */
27 public function getUser()
28 {
29 return $this->user;
30 }
31
32 /**
33 * @param User $user
34 * @return UserEvent
35 */
36 public function setUser(User $user)
37 {
38 $this->user = $user;
39 return $this;
40 }
41}