]>
Commit | Line | Data |
---|---|---|
61351218 TC |
1 | <?php |
2 | ||
3 | namespace Wallabag\CoreBundle\Event; | |
4 | ||
5 | use Symfony\Component\EventDispatcher\Event; | |
6 | use Wallabag\CoreBundle\Entity\Entry; | |
7 | use Wallabag\CoreBundle\Entity\Tag; | |
8 | ||
9 | /** | |
10 | * This event is fired as soon as a tag is added on an entry. | |
11 | */ | |
12 | class EntryTaggedEvent extends Event | |
13 | { | |
14 | const NAME = 'entry.tagged'; | |
15 | ||
16 | /** @var Entry */ | |
17 | protected $entry; | |
18 | ||
19 | /** @var Tag[] */ | |
20 | protected $tags; | |
21 | ||
22 | public function __construct(Entry $entry, $tags) | |
23 | { | |
24 | $this->entry = $entry; | |
25 | ||
26 | if (false === is_array($tags)) { | |
27 | $tags = [$tags]; | |
28 | } | |
29 | ||
30 | $this->tags = $tags; | |
31 | } | |
32 | ||
33 | public function getEntry() | |
34 | { | |
35 | return $this->entry; | |
36 | } | |
37 | ||
38 | public function getTags() | |
39 | { | |
40 | return $this->tags; | |
41 | } | |
42 | } |