Release 2.45 (#5721)
Co-authored-by: Henning Klein <info@henningklein.de>
This commit is contained in:
28
src/Event/AbstractTeamEvent.php
Normal file
28
src/Event/AbstractTeamEvent.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Event;
|
||||
|
||||
use App\Entity\Team;
|
||||
use Symfony\Contracts\EventDispatcher\Event;
|
||||
|
||||
/**
|
||||
* Base event class triggered for Team manipulations.
|
||||
*/
|
||||
abstract class AbstractTeamEvent extends Event
|
||||
{
|
||||
public function __construct(private readonly Team $team)
|
||||
{
|
||||
}
|
||||
|
||||
public function getTeam(): Team
|
||||
{
|
||||
return $this->team;
|
||||
}
|
||||
}
|
||||
17
src/Event/TeamCreateEvent.php
Normal file
17
src/Event/TeamCreateEvent.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Event;
|
||||
|
||||
/**
|
||||
* Triggered for new team instances, which might or might not be saved.
|
||||
*/
|
||||
final class TeamCreateEvent extends AbstractTeamEvent
|
||||
{
|
||||
}
|
||||
17
src/Event/TeamCreatePostEvent.php
Normal file
17
src/Event/TeamCreatePostEvent.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Event;
|
||||
|
||||
use App\Webhook\Attribute\AsWebhook;
|
||||
|
||||
#[AsWebhook(name: 'team.created', description: 'Triggered after a team was created', payload: 'object.getTeam()')]
|
||||
final class TeamCreatePostEvent extends AbstractTeamEvent
|
||||
{
|
||||
}
|
||||
17
src/Event/TeamCreatePreEvent.php
Normal file
17
src/Event/TeamCreatePreEvent.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Event;
|
||||
|
||||
/**
|
||||
* Triggered for team instances, which are just about to being saved.
|
||||
*/
|
||||
final class TeamCreatePreEvent extends AbstractTeamEvent
|
||||
{
|
||||
}
|
||||
17
src/Event/TeamDeleteEvent.php
Normal file
17
src/Event/TeamDeleteEvent.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Event;
|
||||
|
||||
use App\Webhook\Attribute\AsWebhook;
|
||||
|
||||
#[AsWebhook(name: 'team.deleted', description: 'Triggered after a team was deleted', payload: 'object.getTeam()')]
|
||||
final class TeamDeleteEvent extends AbstractTeamEvent
|
||||
{
|
||||
}
|
||||
17
src/Event/TeamUpdatePostEvent.php
Normal file
17
src/Event/TeamUpdatePostEvent.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Event;
|
||||
|
||||
use App\Webhook\Attribute\AsWebhook;
|
||||
|
||||
#[AsWebhook(name: 'team.updated', description: 'Triggered after a team was updated', payload: 'object.getTeam()')]
|
||||
final class TeamUpdatePostEvent extends AbstractTeamEvent
|
||||
{
|
||||
}
|
||||
17
src/Event/TeamUpdatePreEvent.php
Normal file
17
src/Event/TeamUpdatePreEvent.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Event;
|
||||
|
||||
/**
|
||||
* Triggered for team instances, which are just about to being updated.
|
||||
*/
|
||||
final class TeamUpdatePreEvent extends AbstractTeamEvent
|
||||
{
|
||||
}
|
||||
@@ -29,6 +29,8 @@ class ThemeEvent extends Event
|
||||
private string $content = '';
|
||||
|
||||
/**
|
||||
* User is nullable, because theme events are triggered on anonymous pages, like "Login" or "Kiosk"
|
||||
*
|
||||
* @param array<string, mixed|array<mixed>> $payload
|
||||
*/
|
||||
public function __construct(private readonly ?User $user = null, protected array $payload = [])
|
||||
|
||||
Reference in New Issue
Block a user