/** * Implements \JsonSerializable interface * * @return array|mixed */ public function jsonSerialize() { $array = ['series' => $this->series->export(), 'release' => $this->release->export()]; if ($this->page_array !== null) { $array['pages'] = []; foreach ($this->page_array as $page) { $array['pages'][] = $page->export(); } } return $array; }
/** * Implements \JsonSerializable interface * * @return array|mixed */ public function jsonSerialize() { return ['series' => $this->series->export(), 'release' => $this->release->export(), 'page' => $this->page->export()]; }