mirror of
https://github.com/standardebooks/web.git
synced 2025-07-05 22:30:30 -04:00
Use static class names instead of strings when getting objects from the DB
This commit is contained in:
parent
a442f92e28
commit
acb6b2949f
16 changed files with 36 additions and 34 deletions
|
@ -61,7 +61,7 @@ class Poll{
|
|||
from PollItems
|
||||
where PollId = ?
|
||||
order by SortOrder asc
|
||||
', [$this->PollId], 'PollItem');
|
||||
', [$this->PollId], PollItem::class);
|
||||
}
|
||||
|
||||
return $this->_PollItems;
|
||||
|
@ -113,7 +113,7 @@ class Poll{
|
|||
SELECT *
|
||||
from Polls
|
||||
where PollId = ?
|
||||
', [$pollId], 'Poll');
|
||||
', [$pollId], Poll::class);
|
||||
|
||||
return $result[0] ?? throw new Exceptions\PollNotFoundException();
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ class Poll{
|
|||
SELECT *
|
||||
from Polls
|
||||
where UrlName = ?
|
||||
', [$urlName], 'Poll');
|
||||
', [$urlName], Poll::class);
|
||||
|
||||
return $result[0] ?? throw new Exceptions\PollNotFoundException();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue