X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FBaseEntity.php;h=2ee22b1bb0da93056aa1b7d27e0a5a6f1fb20fb7;hb=ab83d0dd27e46e733ecb49f25789bfb318852ac7;hp=a5b968397c7058c72b7c94d59664a90f2f73e3b8;hpb=054c301ef0345c4ff9f35cfd08717757eab17b9d;p=friendica.git diff --git a/src/BaseEntity.php b/src/BaseEntity.php index a5b968397c..2ee22b1bb0 100644 --- a/src/BaseEntity.php +++ b/src/BaseEntity.php @@ -53,4 +53,18 @@ abstract class BaseEntity extends BaseDataTransferObject return $this->$name; } + + /** + * @param $name + * @return bool + * @throws HTTPException\InternalServerErrorException + */ + public function __isset($name) + { + if (!property_exists($this, $name)) { + throw new HTTPException\InternalServerErrorException('Unknown property ' . $name . ' in Entity ' . static::class); + } + + return !empty($this->$name); + } }