mirror of
https://github.com/flarum/core.git
synced 2025-10-12 15:34:26 +02:00
Move command classes to domain namespaces
They will probably be refactored away at a later stage (when we get rid of the command bus). Until then, this lets us remove the Flarum\Core namespace and actually feels quite clean.
This commit is contained in:
59
src/Post/Command/PostReply.php
Normal file
59
src/Post/Command/PostReply.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?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\Post\Command;
|
||||
|
||||
use Flarum\User\User;
|
||||
|
||||
class PostReply
|
||||
{
|
||||
/**
|
||||
* The ID of the discussion to post the reply to.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $discussionId;
|
||||
|
||||
/**
|
||||
* The user who is performing the action.
|
||||
*
|
||||
* @var User
|
||||
*/
|
||||
public $actor;
|
||||
|
||||
/**
|
||||
* The attributes to assign to the new post.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $data;
|
||||
|
||||
/**
|
||||
* The IP address of the actor.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $ipAddress;
|
||||
|
||||
/**
|
||||
* @param int $discussionId The ID of the discussion to post the reply to.
|
||||
* @param User $actor The user who is performing the action.
|
||||
* @param array $data The attributes to assign to the new post.
|
||||
* @param string $ipAddress The IP address of the actor.
|
||||
*/
|
||||
public function __construct($discussionId, User $actor, array $data, $ipAddress = null)
|
||||
{
|
||||
$this->discussionId = $discussionId;
|
||||
$this->actor = $actor;
|
||||
$this->data = $data;
|
||||
$this->ipAddress = $ipAddress;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user