]> git.mxchange.org Git - friendica.git/blobdiff - src/BaseEntity.php
Merge pull request #13161 from annando/bluesky-activities
[friendica.git] / src / BaseEntity.php
index a5b968397c7058c72b7c94d59664a90f2f73e3b8..dca1af4f627b2e29a5494af84bd2666496ce63de 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -53,4 +53,18 @@ abstract class BaseEntity extends BaseDataTransferObject
 
                return $this->$name;
        }
+
+       /**
+        * @param mixed $name
+        * @return bool
+        * @throws HTTPException\InternalServerErrorException
+        */
+       public function __isset($name): bool
+       {
+               if (!property_exists($this, $name)) {
+                       throw new HTTPException\InternalServerErrorException('Unknown property ' . $name . ' of type ' . gettype($name) . ' in Entity ' . static::class);
+               }
+
+               return !empty($this->$name);
+       }
 }