refactor: replace the Model->isset property with a public instance method (#9)

This change is primarily to accommodate the new `Reflect::serialize()` method since we don't want to include the isset property when returning serialized objects.

Reviewed-on: https://codeberg.org/vlw/scaffold/pulls/9
This commit is contained in:
Victor Westerlund 2025-11-01 18:34:48 +01:00
parent feea36b190
commit 014945ee10

View file

@ -72,9 +72,8 @@
* *
* @return bool Entity exists * @return bool Entity exists
*/ */
public bool $isset { public function isset(): bool {
// Returns bool if row is set or attempts to resolve and set if null return $this->_isset ??= new Database()
get => $this->_isset ??= new Database()
->from($this->table) ->from($this->table)
->where($this->where) ->where($this->where)
->limit(1) ->limit(1)