forked from wallabag/wallabag
Use custom event instead of Doctrine ones
This give us ability to use Entry ID to determine where to store images and it’s then more easy to remove them when we remove the entry.
This commit is contained in:
26
src/Wallabag/CoreBundle/Event/EntrySavedEvent.php
Normal file
26
src/Wallabag/CoreBundle/Event/EntrySavedEvent.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Event;
|
||||
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
|
||||
/**
|
||||
* This event is fired as soon as an entry was saved.
|
||||
*/
|
||||
class EntrySavedEvent extends Event
|
||||
{
|
||||
const NAME = 'entry.saved';
|
||||
|
||||
protected $entry;
|
||||
|
||||
public function __construct(Entry $entry)
|
||||
{
|
||||
$this->entry = $entry;
|
||||
}
|
||||
|
||||
public function getEntry()
|
||||
{
|
||||
return $this->entry;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user