示例#1
0
	public function getProperties($modified = false)
	{
		$result = parent::getProperties($modified);

		if (isset($result['children']) && $result['children'] instanceof KModelEntityInterface) {
			$result['children'] = $result['children']->getProperties();
		}

		return $result;
	}
示例#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;
    }
示例#3
0
 public function toArray()
 {
     $data = parent::toArray();
     if ($this->hasChildren()) {
         $data['children'] = array_values($this->getChildren()->toArray());
     }
     return $data;
 }