/** * Adds new properties to the parent (KickAssets) file JSON * * @return array */ protected function buildJSON() { $json = $this->parent->createFileJSON($this->file); $json['created'] = $this->file->obj('Created')->FormatFromSettings(); $json['lastEdited'] = $this->file->obj('LastEdited')->FormatFromSettings(); $json['url'] = $this->file->getAbsoluteURL(); $json['size'] = $this->file->getSize(); $json['folder'] = $this->file->Parent()->Filename; if ($this->file instanceof Image) { $json['previewImage'] = $this->file->CroppedImage(400, 133)->URL; $json['detailImage'] = $this->file->getKickAssetsDetailImage()->URL; } return $json; }