setSource($asset); } /** * Sets the source of the layer. * * @param string|BaseSourceQualifier $source The source. * * @return $this */ public function setSource($source) { if ($source instanceof BaseSourceQualifier) { $this->getSourceQualifier()->setQualifierValue($source->getValue()); return $this; } $assetDescriptor = null; if ($source instanceof BaseAsset) { $assetDescriptor = $source->asset; if ($source->transformation) { $this->transformation = clone $source->transformation; } } else { // string $assetDescriptor = new AssetDescriptor($source); } $this->getSourceQualifier()->setQualifierValue(new SourceValue($assetDescriptor->publicId())); return $this; } }