| @@ 15-41 (lines=27) @@ | ||
| 12 | * @property-read int $name Name of the app |
|
| 13 | * @property-read string $website Homepage URL of the app |
|
| 14 | */ |
|
| 15 | class Application extends Entity |
|
| 16 | { |
|
| 17 | use \Teto\Object\TypedProperty; |
|
| 18 | ||
| 19 | private static $property_types = [ |
|
| 20 | 'name' => 'string', |
|
| 21 | 'website' => 'string', |
|
| 22 | ]; |
|
| 23 | ||
| 24 | public function __construct(array $properties) |
|
| 25 | { |
|
| 26 | $this->setProperties($properties); |
|
| 27 | } |
|
| 28 | ||
| 29 | /** |
|
| 30 | * Returns application data as array |
|
| 31 | * |
|
| 32 | * @return array |
|
| 33 | */ |
|
| 34 | public function toArray() |
|
| 35 | { |
|
| 36 | return [ |
|
| 37 | 'name' => $this->name, |
|
| 38 | 'website' => $this->website, |
|
| 39 | ]; |
|
| 40 | } |
|
| 41 | } |
|
| 42 | ||
| @@ 15-41 (lines=27) @@ | ||
| 12 | * @property-read string $name The hashtag, not including the preceding # |
|
| 13 | * @property-read string $url The URL of the hashtag |
|
| 14 | */ |
|
| 15 | class Tag extends Entity |
|
| 16 | { |
|
| 17 | use \Teto\Object\TypedProperty; |
|
| 18 | ||
| 19 | private static $property_types = [ |
|
| 20 | 'name' => 'string', |
|
| 21 | 'url' => 'string', |
|
| 22 | ]; |
|
| 23 | ||
| 24 | public function __construct(array $properties) |
|
| 25 | { |
|
| 26 | $this->setProperties($properties); |
|
| 27 | } |
|
| 28 | ||
| 29 | /** |
|
| 30 | * Returns tag data as array |
|
| 31 | * |
|
| 32 | * @return array |
|
| 33 | */ |
|
| 34 | public function toArray() |
|
| 35 | { |
|
| 36 | return [ |
|
| 37 | 'name' => $this->name, |
|
| 38 | 'url' => $this->url, |
|
| 39 | ]; |
|
| 40 | } |
|
| 41 | } |
|
| 42 | ||