Korrektur der Schreibweise.

This commit is contained in:
2021-04-06 10:41:40 +02:00
parent 123f5eef81
commit 20fec2dc07
2 changed files with 7 additions and 6 deletions
@@ -44,13 +44,13 @@ class WorkingHoursRepository implements RepositoryReaderInterface, RepositoryWri
public function findAll(): array
{
$models = [];
$stmt = $this->database->prepare('select "Datum" as workingDay, "Arbeitszeit" as workingTime from public."Arbeitszeiten"');
$stmt = $this->database->prepare('select "Datum" as "workingDay", "Arbeitszeit" as "workingTime" from public."Arbeitszeiten"');
$stmt->execute();
while ($row = $stmt->fetch()) {
$model = new WorkingHours();
$model
->setWorkingDay(new DateTime($row['workingday']))
->setWorkingTime(new DateInterval('P0000-00-00T' . $row['workingtime']));
->setWorkingDay(new DateTime($row['workingDay']))
->setWorkingTime(new DateInterval('P0000-00-00T' . $row['workingTime']));
$models[] = $model;
}
return $models;
@@ -68,7 +68,7 @@ class WorkingHoursRepository implements RepositoryReaderInterface, RepositoryWri
*/
public function findByKey(mixed $primary_key): WorkingHours
{
$stmt = $this->database->prepare('select "Datum" as workingDay, "Arbeitszeit" as workingTime from public."Arbeitszeiten" where "Datum" = ?');
$stmt = $this->database->prepare('select "Datum" as "workingDay", "Arbeitszeit" as "workingTime" from public."Arbeitszeiten" where "Datum" = ?');
$stmt->bindParam(1, $primary_key);
$stmt->execute();
$row = $stmt->fetch();
@@ -77,8 +77,8 @@ class WorkingHoursRepository implements RepositoryReaderInterface, RepositoryWri
}
$model = new WorkingHours();
$model
->setWorkingDay(new DateTime($row['workingday']))
->setWorkingTime(new DateInterval('P0000-00-00T' . $row['workingtime']));
->setWorkingDay(new DateTime($row['workingDay']))
->setWorkingTime(new DateInterval('P0000-00-00T' . $row['workingTime']));
return $model;
}