6 * The API entity classes are meant as data transfer objects. As such, their member should be protected.
7 * Then the JsonSerializable interface ensures the protected members will be included in a JSON encode situation.
9 * Constructors are supposed to take as arguments the Friendica dependencies/model/collection/data it needs to
10 * populate the class members.
12 abstract class BaseEntity implements \JsonSerializable
15 * Returns the current entity as an json array
19 public function jsonSerialize()
21 return $this->toArray();
25 * Returns the current entity as an array
29 public function toArray()
31 return get_object_vars($this);