1
0
mirror of https://github.com/flarum/core.git synced 2025-10-14 00:15:51 +02:00
Files
php-flarum/src/Api/Actions/Discussions/DeleteAction.php
2015-08-26 16:56:32 +09:30

47 lines
983 B
PHP

<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\Api\Actions\Discussions;
use Flarum\Core\Discussions\Commands\DeleteDiscussion;
use Flarum\Api\Actions\DeleteAction as BaseDeleteAction;
use Flarum\Api\Request;
use Illuminate\Contracts\Bus\Dispatcher;
class DeleteAction extends BaseDeleteAction
{
/**
* @var Dispatcher
*/
protected $bus;
/**
* @param Dispatcher $bus
*/
public function __construct(Dispatcher $bus)
{
$this->bus = $bus;
}
/**
* {@inheritdoc}
*/
protected function delete(Request $request)
{
$id = $request->get('id');
$actor = $request->actor;
$input = $request->all();
$this->bus->dispatch(
new DeleteDiscussion($id, $actor, $input)
);
}
}