Пример #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;
 }