Пример #1
0
 /**
  * @param $url_id
  * @return Url | null
  */
 public function loadUrl($url_id)
 {
     $user_id = $this->userSession->getUserId();
     $dataObject = $this->urlQuery->getUrlByIdAndUserId($url_id, $user_id);
     if ($dataObject == null) {
         return null;
     }
     return $this->urlDataObjectMapper->mapFromDataObject($dataObject);
 }
Пример #2
0
 public function testDbMapperMapsFromAndToDataObject()
 {
     $now = new DateTime();
     $dataObject = $this->createExampleUrlDataObject(1, 7, $now);
     $url = $this->urlDataObjectMapper->mapFromDataObject($dataObject);
     $mappedDataObject = $this->urlDataObjectMapper->mapToDataObject($url);
     $this->assertInstanceOf('\\Model\\Url', $url);
     $this->assertEquals($dataObject, $mappedDataObject);
 }