예제 #1
0
 /**
  * @param \App\Model\Entities\Article $article
  * @return array Vychozi hodnoty pro formular
  */
 protected function getDefaults($article)
 {
     $result = [];
     $result['id'] = $article->getId();
     $result['title'] = $article->getTitle();
     $result['description'] = $article->getDescription();
     $result['published'] = $article->isPublished();
     $publishDate = $article->getPublishDate();
     if ($publishDate) {
         $result['publishDate'] = $publishDate->format('d. m. Y, H:i');
     }
     $result['content'] = $article->getContent();
     foreach ($article->getTags() as $tag) {
         $result['tags'][] = $tag->getId();
     }
     return $result;
 }