Newscoop\Entity\Article::getView PHP Method

getView() public method

Get view.
public getView ( ) : object
return object
    public function getView()
    {
        try {
            $view = new ArticleView(array('number' => $this->number, 'language' => $this->language->getCode(), 'languageId' => $this->language->getId(), 'title' => $this->name, 'updated' => $this->updated, 'published' => $this->published, 'indexed' => $this->indexed, 'onFrontPage' => $this->onFrontPage, 'onSection' => $this->onSection, 'type' => $this->type, 'webcode' => $this->getWebcode(), 'publication_number' => $this->publication ? $this->publication->getId() : null, 'issue_number' => $this->issue ? $this->issue->getNumber() : null, 'section_number' => $this->section ? $this->section->getNumber() : null, 'keywords' => array_filter(explode(',', $this->keywords))));
        } catch (EntityNotFoundException $e) {
            return new ArticleView();
        }
        $view->authors = $this->authors->map(function ($author) {
            return $author->getView()->name;
        })->toArray();
        $view->topics = $this->topics->map(function ($topic) {
            return $topic->getView()->name;
        })->toArray();
        $this->addFields($view);
        return $view;
    }