setStorageLocation() public method

Sets the storage location.
public setStorageLocation ( StorageLocation $storageLocation )
$storageLocation StorageLocation The storage location to set
Example #1
0
 /**
  * Sets the storage location image.
  *
  * @param StorageLocationImage $image The storage location image
  *
  * @return void
  */
 public function setImage($image)
 {
     if ($image instanceof StorageLocationImage) {
         $image->setStorageLocation($this);
         $this->image = $image;
     } else {
         // Because this is a 1:1 relationship. only allow the temporary image to be set when no image exists.
         // If an image exists, the frontend needs to deliver the old file ID with the replacement property set.
         if ($this->getImage() === null) {
             $this->image = $image;
         }
     }
 }