Skip to content

Commit 12c7eb0

Browse files
committed
Update Entity.php __isset method, to check if datamap or getter method exists.
1 parent e1acfb9 commit 12c7eb0

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

system/Entity.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,15 @@ public function __unset(string $key)
424424
*/
425425
public function __isset(string $key): bool
426426
{
427+
$key = $this->mapProperty($key);
428+
429+
$method = 'get' . str_replace(' ', '', ucwords(str_replace(['-', '_'], ' ', $key)));
430+
431+
if (method_exists($this, $method))
432+
{
433+
return true;
434+
}
435+
427436
return isset($this->attributes[$key]);
428437
}
429438

0 commit comments

Comments
 (0)