Changeset View
Changeset View
Standalone View
Standalone View
src/app/User.php
Show First 20 Lines • Show All 566 Lines • ▼ Show 20 Lines | public function setStatusAttribute($status) | ||||
} | } | ||||
if ($status > 0) { | if ($status > 0) { | ||||
throw new \Exception("Invalid user status: {$status}"); | throw new \Exception("Invalid user status: {$status}"); | ||||
} | } | ||||
$this->attributes['status'] = $new_status; | $this->attributes['status'] = $new_status; | ||||
} | } | ||||
/** | |||||
* String representation of this user. | |||||
* | |||||
* @return string | |||||
*/ | |||||
public function toString() | |||||
machniak: These could be __toString(), but if you don't like magic methods then it's ok. | |||||
{ | |||||
return $this->email; | |||||
} | |||||
} | } |
These could be __toString(), but if you don't like magic methods then it's ok.