Commit 41f3a9c2 authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

UploadedFileRepository: ajout d'un EventDispatcher.

Showing with 17 additions and 0 deletions
+17 -0
......@@ -12,6 +12,8 @@ use Gaufrette\Filesystem;
use Irstea\FileUploadBundle\Entity\UploadedFile;
use Irstea\FileUploadBundle\Service\FileManagerInterface;
use Psr\Log\LogLevel;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
* Description of UploadedFileRepository
......@@ -27,6 +29,11 @@ class UploadedFileRepository extends EntityRepository implements FileManagerInte
*/
protected $filesystem;
/**
* @var EventDispatcher
*/
protected $eventDispatcher;
/**
*
* @param Filesystem $filesystem
......@@ -36,6 +43,15 @@ class UploadedFileRepository extends EntityRepository implements FileManagerInte
$this->filesystem = $filesystem;
}
/**
*
* @param EventDispatcherInterface $eventDispatcher
*/
public function setEventDispatcher(EventDispatcherInterface $eventDispatcher)
{
$this->eventDispatcher = $eventDispatcher;
}
public function create($filename, $size, $mimeType, $lastModified)
{
$file = new UploadedFile();
......
......@@ -18,6 +18,7 @@ services:
calls:
- [ setFilesystem, [ @irstea_file_upload.filesystem ] ]
- [ setLogger, [ @logger ] ]
- [ setEventDispatcher, [ @event_dispatcher ] ]
tags:
- { name: monolog.logger, channel: irstea_file_upload }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment