| @@ 17-47 (lines=31) @@ | ||
| 14 | * @property-read string $description A description for the instance |
|
| 15 | * @property-read string $email An email address which can be used to contact the instance administrator |
|
| 16 | */ |
|
| 17 | class Instance extends Entity |
|
| 18 | { |
|
| 19 | use \Teto\Object\TypedProperty; |
|
| 20 | ||
| 21 | private static $property_types = [ |
|
| 22 | 'uri' => 'string', |
|
| 23 | 'title' => 'string', |
|
| 24 | 'description' => 'string', |
|
| 25 | 'email' => 'string', |
|
| 26 | ]; |
|
| 27 | ||
| 28 | public function __construct(array $properties) |
|
| 29 | { |
|
| 30 | $this->setProperties($properties); |
|
| 31 | } |
|
| 32 | ||
| 33 | /** |
|
| 34 | * Returns instance data as array |
|
| 35 | * |
|
| 36 | * @return array |
|
| 37 | */ |
|
| 38 | public function toArray() |
|
| 39 | { |
|
| 40 | return [ |
|
| 41 | 'uri' => $this->uri, |
|
| 42 | 'title' => $this->title, |
|
| 43 | 'description' => $this->description, |
|
| 44 | 'email' => $this->email, |
|
| 45 | ]; |
|
| 46 | } |
|
| 47 | } |
|
| 48 | ||
| @@ 17-47 (lines=31) @@ | ||
| 14 | * @property-read string $acct Equals username for local users, includes @domain for remote ones |
|
| 15 | * @property-read int $id Account ID |
|
| 16 | */ |
|
| 17 | class Mention extends Entity |
|
| 18 | { |
|
| 19 | use \Teto\Object\TypedProperty; |
|
| 20 | ||
| 21 | private static $property_types = [ |
|
| 22 | 'url' => 'string', |
|
| 23 | 'username' => 'string', |
|
| 24 | 'acct' => 'string', |
|
| 25 | 'id' => 'int', |
|
| 26 | ]; |
|
| 27 | ||
| 28 | public function __construct(array $properties) |
|
| 29 | { |
|
| 30 | $this->setProperties($properties); |
|
| 31 | } |
|
| 32 | ||
| 33 | /** |
|
| 34 | * Returns mention data as array |
|
| 35 | * |
|
| 36 | * @return array |
|
| 37 | */ |
|
| 38 | public function toArray() |
|
| 39 | { |
|
| 40 | return [ |
|
| 41 | 'url' => $this->url, |
|
| 42 | 'username' => $this->username, |
|
| 43 | 'acct' => $this->acct, |
|
| 44 | 'id' => $this->id, |
|
| 45 | ]; |
|
| 46 | } |
|
| 47 | } |
|
| 48 | ||