Example #1
0
 /**
  * @param $data
  * @param $book
  * @return void
  */
 private function addImage($data, $book)
 {
     if (isset($data['image']) && isset($data['image']['guid'])) {
         $image = $this->assetsRepo->assetOfGuid($data['image']['guid']);
         $book->setImage($image);
     }
 }
Example #2
0
 /**
  * @param $data
  * @param $website
  * @return mixed
  */
 private function addImage($data, $website)
 {
     //ADD IMAGE ---------------------)-------------------
     if (isset($data['image']) && isset($data['image']['guid'])) {
         $image = $this->assetsRepo->assetOfGuid($data['image']['guid']);
         $website->setImage($image);
         return $data;
     }
     return $data;
 }
 /**
  * @test
  * @group assetrepo
  */
 public function should_return_null_when_no_guid_found()
 {
     $guid = Guid::generate();
     $asset = $this->assetRepo->assetOfGuid($guid);
     $this->assertNull($asset);
 }
Example #4
0
 /**
  * @param $guid
  * @return Asset
  */
 public function assetOfGuid($guid)
 {
     $guid = Guid::fromNative($guid);
     $asset = $this->assetRepo->assetOfGuid($guid);
     return $asset;
 }