Document/Index/Factory/ExcerptFactory.php
public function create($data, $locale)
    {
        $excerpt = new ExcerptViewObject();

        if (empty($data)) {
            return $excerpt;
        }

        $excerpt->title = $data['title'];
        $excerpt->more = $data['more'];
        $excerpt->description = $data['description'];
        $excerpt->tags = $this->tagCollectionFactory->create($data['tags']);
        $excerpt->categories = $this->categoryCollectionFactory->create($data['categories'], $locale);
        $excerpt->icon = $this->mediaCollectionFactory->create($data['icon'], $locale);
        $excerpt->images = $this->mediaCollectionFactory->create($data['images'], $locale);

        return $excerpt;
    }
public function create($data, $locale)
    {
        $excerpt = new ExcerptViewObject();

        if (empty($data)) {
            return $excerpt;
        }

        $excerpt->title = $data['title'];
        $excerpt->more = $data['more'];
        $excerpt->description = $data['description'];
        $excerpt->tags = $this->tagCollectionFactory->create($data['tags']);
        $excerpt->categories = $this->categoryCollectionFactory->create($data['categories'], $locale);
        $excerpt->icon = $this->mediaCollectionFactory->create($data['icon'], $locale);
        $excerpt->images = $this->mediaCollectionFactory->create($data['images'], $locale);

        return $excerpt;
    }
public function create ( $ data , $ locale ) { $ excerpt = new ExcerptViewObject ( ) ; if ( empty ( $ data ) ) { return $ excerpt ; } $ excerpt -> title = $ data [ 'title' ] ; $ excerpt -> more = $ data [ 'more' ] ; $ excerpt -> description = $ data [ 'description' ] ; $ excerpt -> tags = $ this -> tagCollectionFactory -> create ( $ data [ 'tags' ] ) ; $ excerpt -> categories = $ this -> categoryCollectionFactory -> create ( $ data [ 'categories' ] , $ locale ) ; $ excerpt -> icon = $ this -> mediaCollectionFactory -> create ( $ data [ 'icon' ] , $ locale ) ; $ excerpt -> images = $ this -> mediaCollectionFactory -> create ( $ data [ 'images' ] , $ locale ) ; return $ excerpt ; }
Create a excerpt object by given data.

@param array $data
@param string $locale

@return ExcerptViewObject
Create a excerpt object by given data .