*/ final class ScheduleWasCreatedEvent implements ActionInterface, ScheduleEventInterface { /** * The user that created the schedule. * * @var \CachetHQ\Cachet\Models\User */ public $user; /** * The schedule that has been created. * * @var \CachetHQ\Cachet\Models\Schedule */ public $schedule; /** * Whether to notify that the incident was reported. * * @var bool */ public $notify; /** * Create a new schedule was created event instance. * * @param \CachetHQ\Cachet\Models\User $user * @param \CachetHQ\Cachet\Models\Schedule $schedule * @param bool notify * * @return void */ public function __construct(User $user, Schedule $schedule, $notify = false) { $this->user = $user; $this->schedule = $schedule; $this->notify = $notify; } /** * Get the event description. * * @return string */ public function __toString() { return 'Schedule was created.'; } /** * Get the event action. * * @return array */ public function getAction() { return [ 'user' => $this->user, 'description' => (string) $this, ]; } }