X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FBaseEntity.php;h=a5b968397c7058c72b7c94d59664a90f2f73e3b8;hb=1701ea2034feb1cb8b7cce8455ff8e3c1f8875c6;hp=1ea3f8a16b2d713360c0c7a2d16645fdc6673d59;hpb=2ec3a97393959e42d450e074271d2d622d25701f;p=friendica.git diff --git a/src/BaseEntity.php b/src/BaseEntity.php index 1ea3f8a16b..a5b968397c 100644 --- a/src/BaseEntity.php +++ b/src/BaseEntity.php @@ -1,6 +1,6 @@ toArray(); - } + if (!property_exists($this, $name)) { + throw new HTTPException\InternalServerErrorException('Unknown property ' . $name . ' in Entity ' . static::class); + } - /** - * Returns the current entity as an array - * - * @return array - */ - public function toArray() - { - return get_object_vars($this); + return $this->$name; } }