| @@ 9-82 (lines=74) @@ | ||
| 6 | use Igorsgm\TibiaDataApi\Traits\ImmutableTrait; |
|
| 7 | use Igorsgm\TibiaDataApi\Traits\SerializableTrait; |
|
| 8 | ||
| 9 | class Guild |
|
| 10 | { |
|
| 11 | use ImmutableTrait, SerializableTrait; |
|
| 12 | ||
| 13 | /** |
|
| 14 | * @var string |
|
| 15 | */ |
|
| 16 | private $name; |
|
| 17 | ||
| 18 | /** |
|
| 19 | * @var string |
|
| 20 | */ |
|
| 21 | private $description; |
|
| 22 | ||
| 23 | /** |
|
| 24 | * @var string |
|
| 25 | */ |
|
| 26 | private $logoUrl; |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @var bool |
|
| 30 | */ |
|
| 31 | private $isActive; |
|
| 32 | ||
| 33 | /** |
|
| 34 | * Guild constructor. |
|
| 35 | * @param string $name |
|
| 36 | * @param string $description |
|
| 37 | * @param string $logoUrl |
|
| 38 | * @param bool $isActive |
|
| 39 | * @throws ImmutableException |
|
| 40 | */ |
|
| 41 | public function __construct(string $name, string $description, string $logoUrl, bool $isActive) |
|
| 42 | { |
|
| 43 | $this->handleImmutableConstructor(); |
|
| 44 | ||
| 45 | $this->name = $name; |
|
| 46 | $this->description = $description; |
|
| 47 | $this->logoUrl = $logoUrl; |
|
| 48 | $this->isActive = $isActive; |
|
| 49 | } |
|
| 50 | ||
| 51 | /** |
|
| 52 | * @return string |
|
| 53 | */ |
|
| 54 | public function getName(): string |
|
| 55 | { |
|
| 56 | return $this->name; |
|
| 57 | } |
|
| 58 | ||
| 59 | /** |
|
| 60 | * @return string |
|
| 61 | */ |
|
| 62 | public function getDescription(): string |
|
| 63 | { |
|
| 64 | return $this->description; |
|
| 65 | } |
|
| 66 | ||
| 67 | /** |
|
| 68 | * @return string |
|
| 69 | */ |
|
| 70 | public function getLogoUrl(): string |
|
| 71 | { |
|
| 72 | return $this->logoUrl; |
|
| 73 | } |
|
| 74 | ||
| 75 | /** |
|
| 76 | * @return bool |
|
| 77 | */ |
|
| 78 | public function isActive(): bool |
|
| 79 | { |
|
| 80 | return $this->isActive; |
|
| 81 | } |
|
| 82 | } |
|
| 83 | ||
| @@ 10-83 (lines=74) @@ | ||
| 7 | use Igorsgm\TibiaDataApi\Traits\SerializableTrait; |
|
| 8 | use Illuminate\Support\Collection; |
|
| 9 | ||
| 10 | class Houses |
|
| 11 | { |
|
| 12 | use ImmutableTrait, SerializableTrait; |
|
| 13 | ||
| 14 | /** |
|
| 15 | * @var string |
|
| 16 | */ |
|
| 17 | private $town; |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @var string |
|
| 21 | */ |
|
| 22 | private $world; |
|
| 23 | ||
| 24 | /** |
|
| 25 | * @var string |
|
| 26 | */ |
|
| 27 | private $type; |
|
| 28 | ||
| 29 | /** |
|
| 30 | * @var Collection |
|
| 31 | */ |
|
| 32 | private $houses; |
|
| 33 | ||
| 34 | /** |
|
| 35 | * Houses constructor. |
|
| 36 | * @param string $town |
|
| 37 | * @param string $world |
|
| 38 | * @param string $type |
|
| 39 | * @param array $houses |
|
| 40 | * @throws \Igorsgm\TibiaDataApi\Exceptions\ImmutableException |
|
| 41 | */ |
|
| 42 | public function __construct(string $town, string $world, string $type, Collection $houses) |
|
| 43 | { |
|
| 44 | $this->handleImmutableConstructor(); |
|
| 45 | ||
| 46 | $this->town = $town; |
|
| 47 | $this->world = $world; |
|
| 48 | $this->type = $type; |
|
| 49 | $this->houses = $houses; |
|
| 50 | } |
|
| 51 | ||
| 52 | /** |
|
| 53 | * @return string |
|
| 54 | */ |
|
| 55 | public function getTown(): string |
|
| 56 | { |
|
| 57 | return $this->town; |
|
| 58 | } |
|
| 59 | ||
| 60 | /** |
|
| 61 | * @return string |
|
| 62 | */ |
|
| 63 | public function getWorld(): string |
|
| 64 | { |
|
| 65 | return $this->world; |
|
| 66 | } |
|
| 67 | ||
| 68 | /** |
|
| 69 | * @return string |
|
| 70 | */ |
|
| 71 | public function getType(): string |
|
| 72 | { |
|
| 73 | return $this->type; |
|
| 74 | } |
|
| 75 | ||
| 76 | /** |
|
| 77 | * @return House[] |
|
| 78 | */ |
|
| 79 | public function getHouses(): Collection |
|
| 80 | { |
|
| 81 | return $this->houses; |
|
| 82 | } |
|
| 83 | } |
|
| 84 | ||
| @@ 10-83 (lines=74) @@ | ||
| 7 | use Igorsgm\TibiaDataApi\Traits\ImmutableTrait; |
|
| 8 | use Igorsgm\TibiaDataApi\Traits\SerializableTrait; |
|
| 9 | ||
| 10 | class News |
|
| 11 | { |
|
| 12 | use ImmutableTrait, SerializableTrait; |
|
| 13 | ||
| 14 | /** |
|
| 15 | * @var int |
|
| 16 | */ |
|
| 17 | private $id; |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @var string |
|
| 21 | */ |
|
| 22 | private $title; |
|
| 23 | ||
| 24 | /** |
|
| 25 | * @var string |
|
| 26 | */ |
|
| 27 | private $content; |
|
| 28 | ||
| 29 | /** |
|
| 30 | * @var Carbon |
|
| 31 | */ |
|
| 32 | private $date; |
|
| 33 | ||
| 34 | /** |
|
| 35 | * News constructor. |
|
| 36 | * @param int $id |
|
| 37 | * @param string $title |
|
| 38 | * @param string $content |
|
| 39 | * @param Carbon $date |
|
| 40 | * @throws ImmutableException |
|
| 41 | */ |
|
| 42 | public function __construct(int $id, string $title, string $content, Carbon $date) |
|
| 43 | { |
|
| 44 | $this->handleImmutableConstructor(); |
|
| 45 | ||
| 46 | $this->id = $id; |
|
| 47 | $this->title = $title; |
|
| 48 | $this->content = $content; |
|
| 49 | $this->date = $date; |
|
| 50 | } |
|
| 51 | ||
| 52 | /** |
|
| 53 | * @return int |
|
| 54 | */ |
|
| 55 | public function getId(): int |
|
| 56 | { |
|
| 57 | return $this->id; |
|
| 58 | } |
|
| 59 | ||
| 60 | /** |
|
| 61 | * @return string |
|
| 62 | */ |
|
| 63 | public function getTitle(): string |
|
| 64 | { |
|
| 65 | return $this->title; |
|
| 66 | } |
|
| 67 | ||
| 68 | /** |
|
| 69 | * @return string |
|
| 70 | */ |
|
| 71 | public function getContent(): string |
|
| 72 | { |
|
| 73 | return $this->content; |
|
| 74 | } |
|
| 75 | ||
| 76 | /** |
|
| 77 | * @return Carbon |
|
| 78 | */ |
|
| 79 | public function getDate(): Carbon |
|
| 80 | { |
|
| 81 | return $this->date; |
|
| 82 | } |
|
| 83 | } |
|
| 84 | ||