| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace App\Models\DTO\Movie;
- use JsonSerializable;
- class CompanyParams implements JsonSerializable
- {
- public string $key;
- public function __construct(
- public int $curPage = 1,
- public int $itemPerPage = 20,
- public string|null $companyNm = null,
- public string|null $ceoNm = null,
- public string|null $companyPartCd = null,
- public string $companyCd = ""
- ) {
- $this->key = KOBIS_API_1;
- }
- public function jsonSerialize(): array
- {
- return [
- 'curPage' => $this->curPage,
- 'itemPerPage' => $this->itemPerPage,
- 'companyNm' => $this->companyNm,
- 'ceoNm' => $this->ceoNm,
- 'companyPartCd' => $this->companyPartCd,
- 'companyCd' => $this->companyCd
- ];
- }
- public function toArray(): array
- {
- return [
- 'key' => $this->key,
- 'curPage' => $this->curPage,
- 'itemPerPage' => $this->itemPerPage,
- 'companyNm' => $this->companyNm,
- 'ceoNm' => $this->ceoNm,
- 'companyPartCd' => $this->companyPartCd,
- 'companyCd' => $this->companyCd
- ];
- }
- public function toJson(): string|false
- {
- return json_encode([
- 'curPage' => $this->curPage,
- 'itemPerPage' => $this->itemPerPage,
- 'companyNm' => $this->companyNm,
- 'ceoNm' => $this->ceoNm,
- 'companyPartCd' => $this->companyPartCd,
- 'companyCd' => $this->companyCd
- ]);
- }
- }
|