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