|
|
@ -16,18 +16,18 @@ class HistoryRepository extends ServiceEntityRepository implements HistoryReposi |
|
|
|
parent::__construct($registry, History::class); |
|
|
|
} |
|
|
|
|
|
|
|
public function findTempByDateAt(DateTimeInterface $date_at): ?float |
|
|
|
public function findTempByDateAt(DateTimeInterface $date_at): array |
|
|
|
{ |
|
|
|
$history = $this->findOneBy(['date_at' => $date_at]); |
|
|
|
|
|
|
|
if (null !== $history) { |
|
|
|
return $history->getTemp(); |
|
|
|
return ['temp' => $history->getTemp()]; |
|
|
|
} |
|
|
|
|
|
|
|
return null; |
|
|
|
return []; |
|
|
|
} |
|
|
|
|
|
|
|
public function findWithLimit(int $limit): ?array |
|
|
|
public function findWithLimit(int $limit): array |
|
|
|
{ |
|
|
|
$histories = $this->findBy([], ['date_at' => 'DESC'], $limit); |
|
|
|
|
|
|
@ -43,6 +43,6 @@ class HistoryRepository extends ServiceEntityRepository implements HistoryReposi |
|
|
|
return $result; |
|
|
|
} |
|
|
|
|
|
|
|
return null; |
|
|
|
return []; |
|
|
|
} |
|
|
|
} |