stackPosition === LayerStackPosition::UNDERLAY) { return 'u'; } return 'l'; } /** * Gets component full name. * * @return string Component name. */ public function getFullName() { return ArrayUtils::implodeFiltered('_', [parent::getFullName(), $this->stackPosition]); } /** * Sets stack position of the source. * * @param string $stackPosition The stack position. * * @return $this */ public function setStackPosition($stackPosition) { $this->stackPosition = $stackPosition; return $this; } /** * Sets the asset type. * * @param string $assetType The type of the asset. * * @return $this */ public function assetType($assetType) { $this->assetType = $assetType; return $this; } /** * Serializes to string. * * @return string */ public function __toString() { $sourceTypeStr = $this->sourceType ? "$this->sourceType:" : ''; $assetTypeStr = $this->assetType && $this->assetType != "image" ? "$this->assetType:" : ''; return empty((string)$this->value) ? '' : "{$this->getSourceKey()}_$assetTypeStr$sourceTypeStr$this->value"; } }