コード例 #1
0
 /**
  * @param Url $url
  * @return UrlDataObject
  */
 public function mapToDataObject(Url $url)
 {
     $urlDataObject = new UrlDataObject();
     $urlDataObject->id = $url->getId();
     $urlDataObject->userId = $url->getUserId();
     $urlDataObject->url = $url->getUrl();
     $urlDataObject->title = $url->getTitle();
     $urlDataObject->description = $url->getDescription();
     $urlDataObject->created = $url->getCreated()->format('c');
     $urlDataObject->updated = $url->getUpdated()->format('c');
     return $urlDataObject;
 }
コード例 #2
0
 /**
  * @param Url $url
  * @param string $edit_link
  * @return Template
  */
 public function buildUrlListEntry(Url $url, $edit_link)
 {
     $urlListEntry = $this->templateBuilder->createTemplate();
     $urlListEntry->loadFile('urlListEntry.html')->addPlaceHolder('id', $url->getId())->addPlaceHolder('url', $url->getUrl())->addPlaceHolder('title', $url->getTitle())->addPlaceHolder('description', $url->getDescription())->addPlaceHolder('updated', $url->getUpdated()->format('d.m.Y'))->addPlaceHolder('edit_link', $edit_link);
     return $urlListEntry;
 }