Bessere Name.
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user