allow to delete invoice documents (#2968)

This commit is contained in:
Kevin Papst
2021-11-24 10:30:49 +01:00
committed by GitHub
parent ff9acab0fc
commit b062164277
12 changed files with 362 additions and 23 deletions

View File

@@ -0,0 +1,65 @@
<?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\InvoiceDocument;
use Symfony\Contracts\EventDispatcher\Event;
final class InvoiceDocumentsEvent extends Event
{
/**
* @var InvoiceDocument[]
*/
private $documents;
/**
* Maximum amount of allowed invoice documents.
* @var int
*/
private $maximum = 99;
/**
* @param InvoiceDocument[] $documents
*/
public function __construct(array $documents)
{
$this->documents = $documents;
}
/**
* @return InvoiceDocument[]
*/
public function getInvoiceDocuments(): array
{
return $this->documents;
}
public function addInvoiceDocuments(InvoiceDocument $document): void
{
$this->documents[] = $document;
}
/**
* @param InvoiceDocument[] $documents
*/
public function setInvoiceDocuments(array $documents): void
{
$this->documents = $documents;
}
public function setMaximumAllowedDocuments(int $max): void
{
$this->maximum = $max;
}
public function getMaximumAllowedDocuments(): int
{
return $this->maximum;
}
}