Skip to content

Commit

Permalink
Wasn't included for some reason
Browse files Browse the repository at this point in the history
  • Loading branch information
ZoranSerdic committed Apr 8, 2024
1 parent 323385c commit 7bef582
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions app/repository/RestaurantRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,38 @@ public function getRestaurantById(int $id): ?Restaurant
return $restaurant;
}

public function getYummyEventDayById(int $id): ?YummyEventDays
{
$query = $this->connection->prepare('SELECT * FROM YummyEventDays WHERE DayID = ?');
$query->execute([$id]);

$query->setFetchMode(PDO::FETCH_CLASS, "\Model\YummyEventDays");

$yummyEventDay = $query->fetch();

if ($yummyEventDay === false) {
return null;
}

return $yummyEventDay;
}

public function getSessionById(int $id): ?Session
{
$query = $this->connection->prepare('SELECT * FROM Session WHERE SessionID = ?');
$query->execute([$id]);

$query->setFetchMode(PDO::FETCH_CLASS, "\Model\Session");

$session = $query->fetch();

if ($session === false) {
return null;
}

return $session;
}

public function yummyExists(int $id): bool
{
$query = $this->connection->prepare('SELECT COUNT(*) FROM YummyHome WHERE YummyID = ?');
Expand Down

0 comments on commit 7bef582

Please sign in to comment.