added option to delete invoice template (#294)

This commit is contained in:
Kevin Papst
2018-09-02 11:36:04 +02:00
committed by GitHub
parent 6fb6a16246
commit 9f6079ad8a
21 changed files with 281 additions and 83 deletions

View File

@@ -54,4 +54,35 @@ class InvoiceTemplateRepository extends AbstractRepository
return $this->getBaseQueryResult($qb, $query);
}
/**
* @param InvoiceTemplate $template
* @return InvoiceTemplate
* @throws RepositoryException
*/
public function saveTemplate(InvoiceTemplate $template)
{
try {
$this->getEntityManager()->persist($template);
$this->getEntityManager()->flush();
} catch (\Exception $ex) {
throw new RepositoryException('Could not save InvoiceTemplate');
}
return $template;
}
/**
* @param InvoiceTemplate $template
* @throws RepositoryException
*/
public function removeTemplate(InvoiceTemplate $template)
{
try {
$this->getEntityManager()->remove($template);
$this->getEntityManager()->flush();
} catch (\Exception $ex) {
throw new RepositoryException('Could not remove InvoiceTemplate');
}
}
}