Cachet/app/Bus/Events/IncidentUpdate/IncidentUpdateWasUpdatedEvent.php

75 lines
1.6 KiB
PHP
Raw Normal View History

2016-10-06 17:21:18 +01:00
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Cachet\Bus\Events\IncidentUpdate;
2017-02-03 22:34:13 +00:00
use CachetHQ\Cachet\Bus\Events\ActionInterface;
2016-10-06 17:21:18 +01:00
use CachetHQ\Cachet\Models\IncidentUpdate;
2017-02-03 22:34:13 +00:00
use CachetHQ\Cachet\Models\User;
2016-10-06 17:21:18 +01:00
/**
* This is the incident update was updated event.
*
* @author James Brooks <james@alt-three.com>
*/
2017-02-03 22:34:13 +00:00
final class IncidentUpdateWasUpdatedEvent implements ActionInterface, IncidentUpdateEventInterface
2016-10-06 17:21:18 +01:00
{
2017-02-03 22:34:13 +00:00
/**
* The user who updated the incident update.
*
* @var \CachetHQ\Cachet\Models\User
*/
public $user;
2016-10-06 17:21:18 +01:00
/**
* The incident update that has been updated.
*
* @var \CachetHQ\Cachet\Models\IncidentUpdate
*/
public $update;
/**
* Create a new incident update was updated event instance.
*
* @param \CachetHQ\Cachet\Models\IncidentUpdate $update
*
* @return void
*/
2017-02-03 22:34:13 +00:00
public function __construct(User $user, IncidentUpdate $update)
2016-10-06 17:21:18 +01:00
{
2017-02-03 22:34:13 +00:00
$this->user = $user;
2016-10-06 17:21:18 +01:00
$this->update = $update;
}
/**
* Get the event description.
*
* @return string
*/
public function __toString()
{
return 'Incident Update was updated.';
}
2017-02-03 22:34:13 +00:00
/**
* Get the event action.
*
* @return array
*/
public function getAction()
{
return [
'user' => $this->user,
'description' => (string) $this,
];
}
2016-10-06 17:21:18 +01:00
}