Files
firefly-iii/app/Events/RequestedReportOnJournals.php

73 lines
2.0 KiB
PHP
Raw Normal View History

2018-06-25 16:01:45 +02:00
<?php
2018-12-31 07:48:23 +01:00
/**
* RequestedReportOnJournals.php
2020-01-25 06:08:56 +01:00
* Copyright (c) 2019 james@firefly-iii.org
2018-12-31 07:48:23 +01:00
*
* This file is part of Firefly III (https://github.com/firefly-iii).
2018-12-31 07:48:23 +01:00
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
2018-12-31 07:48:23 +01:00
*
* This program is distributed in the hope that it will be useful,
2018-12-31 07:48:23 +01:00
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
2018-12-31 07:48:23 +01:00
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2018-12-31 07:48:23 +01:00
*/
declare(strict_types=1);
2018-06-25 16:01:45 +02:00
namespace FireflyIII\Events;
2019-06-07 18:13:54 +02:00
use Illuminate\Broadcasting\Channel;
2018-06-25 16:01:45 +02:00
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Collection;
use Log;
/**
* Class RequestedReportOnJournals
*
* @codeCoverageIgnore
2018-06-25 16:01:45 +02:00
*/
class RequestedReportOnJournals
{
use Dispatchable, InteractsWithSockets, SerializesModels;
2019-08-18 11:16:33 +02:00
/** @var Collection The transaction groups to report on. */
public $groups;
2018-07-06 07:19:19 +02:00
/** @var int The ID of the user. */
2018-06-25 16:01:45 +02:00
public $userId;
2020-07-31 12:45:02 +02:00
2018-06-25 16:01:45 +02:00
/**
* Create a new event instance.
*
* @param int $userId
2019-08-18 11:16:33 +02:00
* @param Collection $groups
2018-06-25 16:01:45 +02:00
*/
2019-08-18 11:16:33 +02:00
public function __construct(int $userId, Collection $groups)
2018-06-25 16:01:45 +02:00
{
Log::debug('In event RequestedReportOnJournals.');
$this->userId = $userId;
2019-08-18 11:16:33 +02:00
$this->groups = $groups;
2018-06-25 16:01:45 +02:00
}
/**
* Get the channels the event should broadcast on.
*
2019-06-07 18:13:54 +02:00
* @return Channel|array
2018-06-25 16:01:45 +02:00
*/
public function broadcastOn()
{
return new PrivateChannel('channel-name');
}
}