Bessere Name.

This commit is contained in:
2021-04-07 12:11:01 +02:00
parent 3e2865dbe7
commit 8086b86eb2
6 changed files with 17 additions and 17 deletions
@@ -1,10 +0,0 @@
<?php
namespace TorstenHettstedt\TimekeepingApi\Repositories;
class RepositoryModelAlreadyExists extends RepositoryException
{
}
@@ -0,0 +1,10 @@
<?php
namespace TorstenHettstedt\TimekeepingApi\Repositories;
class RepositoryRecordAlreadyExistException extends RepositoryException
{
}
@@ -11,7 +11,7 @@ interface RepositoryWriterInterface
/**
* @param T $model
*
* @throws RepositoryModelAlreadyExists
* @throws RepositoryRecordAlreadyExistException
*/
public function insert(mixed $model): void;
@@ -85,7 +85,7 @@ class WorkingHoursRepository implements RepositoryReaderInterface, RepositoryWri
/**
* @param WorkingHours|ModelInterface $model
*
* @throws RepositoryModelAlreadyExists
* @throws RepositoryRecordAlreadyExistException
* @throws Exception
*/
public function insert(mixed $model): void
@@ -99,7 +99,7 @@ class WorkingHoursRepository implements RepositoryReaderInterface, RepositoryWri
try {
$this->findByKey($workingDay);
throw new RepositoryModelAlreadyExists();
throw new RepositoryRecordAlreadyExistException();
} /** @noinspection PhpUnusedLocalVariableInspection */
catch (RepositoryRecordNotFoundException $exception) {
$stmt = $this->database->prepare('insert into public."Arbeitszeiten" ("Datum", "Arbeitszeit") values (?, ?) on conflict do nothing');