AsseticBundle\Service::moveRaw PHP Method

moveRaw() public method

public moveRaw ( Assetic\Asset\AssetCollection $asset, string | null $targetPath, Assetic\Factory\AssetFactory $factory, boolean $disableSourcePath = false )
$asset Assetic\Asset\AssetCollection
$targetPath string | null
$factory Assetic\Factory\AssetFactory
$disableSourcePath boolean
    public function moveRaw(AssetCollection $asset, $targetPath, Factory\AssetFactory $factory, $disableSourcePath = false)
    {
        foreach ($asset as $value) {
            /** @var $value AssetInterface */
            if ($disableSourcePath) {
                $value->setTargetPath(($targetPath ? $targetPath : '') . basename($value->getSourcePath()));
            } else {
                $value->setTargetPath(($targetPath ? $targetPath : '') . $value->getSourcePath());
            }
            $value = $this->cacheAsset($value);
            $this->writeAsset($value, $factory);
        }
    }