mirror of
https://github.com/standardebooks/web.git
synced 2025-07-12 17:42:29 -04:00
Use shorthand assignment for basic getters
This commit is contained in:
parent
99b5fd66f2
commit
7f5ffb4aea
21 changed files with 142 additions and 326 deletions
|
@ -20,16 +20,12 @@ class PollItem{
|
|||
// *******
|
||||
|
||||
protected function GetVoteCount(): int{
|
||||
if(!isset($this->_VoteCount)){
|
||||
$this->_VoteCount = Db::QueryInt('
|
||||
return $this->_VoteCount ??= Db::QueryInt('
|
||||
SELECT count(*)
|
||||
from PollVotes pv
|
||||
inner join PollItems pi using (PollItemId)
|
||||
where pi.PollItemId = ?
|
||||
', [$this->PollItemId]);
|
||||
}
|
||||
|
||||
return $this->_VoteCount;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue