prevent accidental invoice template updates (#3493)

This commit is contained in:
Kevin Papst
2022-08-31 13:18:21 +02:00
committed by GitHub
parent ad20fd1c64
commit 718e0b5c1e
2 changed files with 15 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ namespace App\Repository;
use App\Entity\Customer;
use App\Entity\Invoice;
use App\Entity\InvoiceMeta;
use App\Entity\InvoiceTemplate;
use App\Entity\Team;
use App\Entity\User;
use App\Repository\Loader\InvoiceLoader;
@@ -29,6 +30,17 @@ class InvoiceRepository extends EntityRepository
{
use RepositorySearchTrait;
/**
* @param InvoiceTemplate $invoiceTemplate
* @return void
* @deprecated replace me in 2.0
*/
public function preventTemplateUpdate(InvoiceTemplate $invoiceTemplate): void
{
$em = $this->getEntityManager();
$em->detach($invoiceTemplate);
}
public function saveInvoice(Invoice $invoice)
{
$entityManager = $this->getEntityManager();