]> git.mxchange.org Git - friendica.git/blobdiff - src/BaseEntity.php
Merge remote-tracking branch 'upstream/develop' into item-view
[friendica.git] / src / BaseEntity.php
index 9f0cb31f8ea5c8297b34c3112dc6c9f59fe24f53..1ea3f8a16b2d713360c0c7a2d16645fdc6673d59 100644 (file)
@@ -1,4 +1,23 @@
 <?php
+/**
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
 
 namespace Friendica;
 
@@ -11,7 +30,22 @@ namespace Friendica;
  */
 abstract class BaseEntity implements \JsonSerializable
 {
+       /**
+        * Returns the current entity as an json array
+        *
+        * @return array
+        */
        public function jsonSerialize()
+       {
+               return $this->toArray();
+       }
+
+       /**
+        * Returns the current entity as an array
+        *
+        * @return array
+        */
+       public function toArray()
        {
                return get_object_vars($this);
        }