mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 23:06:08 -06:00
Merge pull request #951 from openclassify/vedatakdogan
created deleted and deleting event
This commit is contained in:
commit
9bf5914e51
@ -3,6 +3,8 @@
|
|||||||
use Visiosoft\AdvsModule\Adv\Command\DeleteOptionConfiguration;
|
use Visiosoft\AdvsModule\Adv\Command\DeleteOptionConfiguration;
|
||||||
use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
|
use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
|
||||||
use Anomaly\Streams\Platform\Entry\EntryObserver;
|
use Anomaly\Streams\Platform\Entry\EntryObserver;
|
||||||
|
use Visiosoft\AdvsModule\Adv\Event\DeletedAd;
|
||||||
|
use Visiosoft\AdvsModule\Adv\Event\DeletingAd;
|
||||||
|
|
||||||
class AdvObserver extends EntryObserver
|
class AdvObserver extends EntryObserver
|
||||||
{
|
{
|
||||||
@ -10,6 +12,14 @@ class AdvObserver extends EntryObserver
|
|||||||
{
|
{
|
||||||
$this->dispatch(new DeleteOptionConfiguration($entry));
|
$this->dispatch(new DeleteOptionConfiguration($entry));
|
||||||
|
|
||||||
|
event(new DeletingAd($entry));
|
||||||
|
|
||||||
parent::deleting($entry);
|
parent::deleting($entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function deleted(EntryInterface $entry)
|
||||||
|
{
|
||||||
|
event(new DeletedAd($entry));
|
||||||
|
parent::deleted($entry);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,17 @@
|
|||||||
|
<?php namespace Visiosoft\AdvsModule\Adv\Event;
|
||||||
|
|
||||||
|
|
||||||
|
class DeletedAd
|
||||||
|
{
|
||||||
|
protected $entry;
|
||||||
|
|
||||||
|
public function __construct($entry)
|
||||||
|
{
|
||||||
|
$this->entry = $entry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getEntry()
|
||||||
|
{
|
||||||
|
return $this->entry;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
<?php namespace Visiosoft\AdvsModule\Adv\Event;
|
||||||
|
|
||||||
|
|
||||||
|
class DeletingAd
|
||||||
|
{
|
||||||
|
protected $entry;
|
||||||
|
|
||||||
|
public function __construct($entry)
|
||||||
|
{
|
||||||
|
$this->entry = $entry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getEntry()
|
||||||
|
{
|
||||||
|
return $this->entry;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -662,8 +662,8 @@ class AdvsController extends PublicController
|
|||||||
$this->messages->error(trans('visiosoft.module.advs::message.delete_author_error'));
|
$this->messages->error(trans('visiosoft.module.advs::message.delete_author_error'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$advs->softDeleteAdv($id);
|
$ad->delete();
|
||||||
$this->messages->error(trans('visiosoft.module.advs::message.success_delete'));
|
$this->messages->success(trans('visiosoft.module.advs::message.success_delete'));
|
||||||
return back();
|
return back();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user