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
|
@ -26,17 +26,13 @@ class Patron{
|
|||
// *******
|
||||
|
||||
protected function GetLastPayment(): ?Payment{
|
||||
if(!isset($this->_LastPayment)){
|
||||
$this->_LastPayment = Db::Query('
|
||||
return $this->_LastPayment ??= Db::Query('
|
||||
SELECT *
|
||||
from Payments
|
||||
where UserId = ?
|
||||
order by Created desc
|
||||
limit 1
|
||||
', [$this->UserId], Payment::class)[0] ?? null;
|
||||
}
|
||||
|
||||
return $this->_LastPayment;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue