Skip to content

Commit

Permalink
Fixed bug with remove entity.
Browse files Browse the repository at this point in the history
  • Loading branch information
nilov committed Nov 1, 2016
1 parent e9fbc7f commit 943bec5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Entity/Listener/MediaListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct(UploaderManager $uploaderManager)
* @param Media $media
* @param LifecycleEventArgs $event
*/
public function postRemoveHandler(Media $media, LifecycleEventArgs $event)
public function preRemoveHandler(Media $media, LifecycleEventArgs $event)
{
$this->uploaderManager->removeMediaFromStorage($media);
}
Expand Down
2 changes: 1 addition & 1 deletion Resources/config/doctrine/Media.orm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<entity-listeners>
<entity-listener class="Glavweb\UploaderBundle\Entity\Listener\MediaListener">
<lifecycle-callback type="postRemove" method="postRemoveHandler" />
<lifecycle-callback type="preRemove" method="preRemoveHandler" />
</entity-listener>
</entity-listeners>

Expand Down

0 comments on commit 943bec5

Please sign in to comment.