| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- namespace App\Models\DTO\Movie;
- use JsonSerializable;
- class ListParams implements JsonSerializable
- {
- public string $key;
- public function __construct(
- public int|null $curPage = null,
- public int $itemPerPage = 10,
- public string|null $movieNm = "",
- public string|null $directorNm = null,
- public string|null $openStartDt = null,
- public string|null $openEndDt = null,
- public string|null $prdtStartYear = null,
- public string|null $prdtEndYear = null,
- public string|null $repNationCd = null,
- public string|null $movieTypeCd = null
- ) {
- $this->key = KOBIS_API_1;
- }
- public function jsonSerialize(): array
- {
- return [
- 'curPage' => $this->curPage,
- 'itemPerPage' => $this->itemPerPage,
- 'movieNm' => $this->movieNm,
- 'directorNm' => $this->directorNm,
- 'openStartDt' => $this->openStartDt,
- 'openEndDt' => $this->openEndDt,
- 'prdtStartYear' => $this->prdtStartYear,
- 'prdtEndYear' => $this->prdtEndYear,
- 'repNationCd' => $this->repNationCd,
- 'movieTypeCd' => $this->movieTypeCd
- ];
- }
- public function toArray(): array
- {
- return [
- 'key' => $this->key,
- 'curPage' => $this->curPage,
- 'itemPerPage' => $this->itemPerPage,
- 'movieNm' => $this->movieNm,
- 'directorNm' => $this->directorNm,
- 'openStartDt' => $this->openStartDt,
- 'openEndDt' => $this->openEndDt,
- 'prdtStartYear' => $this->prdtStartYear,
- 'prdtEndYear' => $this->prdtEndYear,
- 'repNationCd' => $this->repNationCd,
- 'movieTypeCd' => $this->movieTypeCd
- ];
- }
- public function toJson(): string|false
- {
- return json_encode([
- 'curPage' => $this->curPage,
- 'itemPerPage' => $this->itemPerPage,
- 'movieNm' => $this->movieNm,
- 'directorNm' => $this->directorNm,
- 'openStartDt' => $this->openStartDt,
- 'openEndDt' => $this->openEndDt,
- 'prdtStartYear' => $this->prdtStartYear,
- 'prdtEndYear' => $this->prdtEndYear,
- 'repNationCd' => $this->repNationCd,
- 'movieTypeCd' => $this->movieTypeCd
- ]);
- }
- }
|