added API for handling work contract times (#4016)
This commit is contained in:
37
src/Event/WorkingTimeYearSummaryEvent.php
Normal file
37
src/Event/WorkingTimeYearSummaryEvent.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?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\WorkingTime\Model\Year;
|
||||
use App\WorkingTime\Model\YearPerUserSummary;
|
||||
use App\WorkingTime\Model\YearSummary;
|
||||
use Symfony\Contracts\EventDispatcher\Event;
|
||||
|
||||
final class WorkingTimeYearSummaryEvent extends Event
|
||||
{
|
||||
public function __construct(private YearPerUserSummary $yearPerUserSummary, private \DateTimeInterface $until)
|
||||
{
|
||||
}
|
||||
|
||||
public function getYear(): Year
|
||||
{
|
||||
return $this->yearPerUserSummary->getYear();
|
||||
}
|
||||
|
||||
public function getUntil(): \DateTimeInterface
|
||||
{
|
||||
return $this->until;
|
||||
}
|
||||
|
||||
public function addSummary(YearSummary $yearSummary): void
|
||||
{
|
||||
$this->yearPerUserSummary->addSummary($yearSummary);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user