mirror of
https://github.com/flarum/core.git
synced 2025-10-18 18:26:07 +02:00
Extract Flarum\Group namespace
This commit is contained in:
38
src/Group/Event/Created.php
Normal file
38
src/Group/Event/Created.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?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\Group\Event;
|
||||
|
||||
use Flarum\Group\Group;
|
||||
use Flarum\User\User;
|
||||
|
||||
class Created
|
||||
{
|
||||
/**
|
||||
* @var \Flarum\Group\Group
|
||||
*/
|
||||
public $group;
|
||||
|
||||
/**
|
||||
* @var User
|
||||
*/
|
||||
public $actor;
|
||||
|
||||
/**
|
||||
* @param Group $group
|
||||
* @param User $actor
|
||||
*/
|
||||
public function __construct(Group $group, User $actor = null)
|
||||
{
|
||||
$this->group = $group;
|
||||
$this->actor = $actor;
|
||||
}
|
||||
}
|
38
src/Group/Event/Deleted.php
Normal file
38
src/Group/Event/Deleted.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?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\Group\Event;
|
||||
|
||||
use Flarum\Group\Group;
|
||||
use Flarum\User\User;
|
||||
|
||||
class Deleted
|
||||
{
|
||||
/**
|
||||
* @var \Flarum\Group\Group
|
||||
*/
|
||||
public $group;
|
||||
|
||||
/**
|
||||
* @var User
|
||||
*/
|
||||
public $actor;
|
||||
|
||||
/**
|
||||
* @param \Flarum\Group\Group $group
|
||||
* @param User $actor
|
||||
*/
|
||||
public function __construct(Group $group, User $actor = null)
|
||||
{
|
||||
$this->group = $group;
|
||||
$this->actor = $actor;
|
||||
}
|
||||
}
|
51
src/Group/Event/Deleting.php
Normal file
51
src/Group/Event/Deleting.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?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\Group\Event;
|
||||
|
||||
use Flarum\Group\Group;
|
||||
use Flarum\User\User;
|
||||
|
||||
class Deleting
|
||||
{
|
||||
/**
|
||||
* The group that will be deleted.
|
||||
*
|
||||
* @var Group
|
||||
*/
|
||||
public $group;
|
||||
|
||||
/**
|
||||
* The user who is performing the action.
|
||||
*
|
||||
* @var User
|
||||
*/
|
||||
public $actor;
|
||||
|
||||
/**
|
||||
* Any user input associated with the command.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $data;
|
||||
|
||||
/**
|
||||
* @param Group $group The group that will be deleted.
|
||||
* @param User $actor The user performing the action.
|
||||
* @param array $data Any user input associated with the command.
|
||||
*/
|
||||
public function __construct(Group $group, User $actor, array $data)
|
||||
{
|
||||
$this->group = $group;
|
||||
$this->actor = $actor;
|
||||
$this->data = $data;
|
||||
}
|
||||
}
|
38
src/Group/Event/Renamed.php
Normal file
38
src/Group/Event/Renamed.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?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\Group\Event;
|
||||
|
||||
use Flarum\Group\Group;
|
||||
use Flarum\User\User;
|
||||
|
||||
class Renamed
|
||||
{
|
||||
/**
|
||||
* @var \Flarum\Group\Group
|
||||
*/
|
||||
public $group;
|
||||
|
||||
/**
|
||||
* @var User
|
||||
*/
|
||||
public $actor;
|
||||
|
||||
/**
|
||||
* @param \Flarum\Group\Group $group
|
||||
* @param User $actor
|
||||
*/
|
||||
public function __construct(Group $group, User $actor = null)
|
||||
{
|
||||
$this->group = $group;
|
||||
$this->actor = $actor;
|
||||
}
|
||||
}
|
51
src/Group/Event/Saving.php
Normal file
51
src/Group/Event/Saving.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?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\Group\Event;
|
||||
|
||||
use Flarum\Group\Group;
|
||||
use Flarum\User\User;
|
||||
|
||||
class Saving
|
||||
{
|
||||
/**
|
||||
* The group that will be saved.
|
||||
*
|
||||
* @var \Flarum\Group\Group
|
||||
*/
|
||||
public $group;
|
||||
|
||||
/**
|
||||
* The user who is performing the action.
|
||||
*
|
||||
* @var User
|
||||
*/
|
||||
public $actor;
|
||||
|
||||
/**
|
||||
* The attributes to update on the group.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $data;
|
||||
|
||||
/**
|
||||
* @param Group $group The group that will be saved.
|
||||
* @param User $actor The user who is performing the action.
|
||||
* @param array $data The attributes to update on the group.
|
||||
*/
|
||||
public function __construct(Group $group, User $actor, array $data)
|
||||
{
|
||||
$this->group = $group;
|
||||
$this->actor = $actor;
|
||||
$this->data = $data;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user