public function toArray() { $data = parent::toArray(); if ($this->hasChildren()) { $data['children'] = array_values($this->getChildren()->toArray()); } return $data; }
public function toArray() { $data = parent::toArray(); unset($data['file']); unset($data['contents']); $data['metadata'] = $this->metadata; if ($this->isImage()) { $data['type'] = 'image'; } return $data; }