Returns an asset type object for the requested type.

If no assets are found, an AssetType object containing no assets is returned.

@param string $assetType
@return AssetTypeInterface
161176
public function getAssetType(string $assetType) : AssetTypeInterface
    {
        if (!isset($this->assetTypes[$assetType])) {
            if (isset($this->assetTypesArray[$assetType])) {
                $this->assetTypes[$assetType] = ImmutableAssetType::fromArray($assetType, $this->assetTypesArray[$assetType]);
            } else {
                $this->assetTypes[$assetType] = ImmutableAssetType::fromArray($assetType, []);
            }
        }
        return $this->assetTypes[$assetType];
    }
734806
public function getAssetUrl($type, $assetName)
    {
        $file = $this->assetManager->getAssetFile($type, $assetName);
        
        if ($file === false) {
            return;
        }
        
        $cachedFile = $this->generateCachedFile($type, $file->getFileName());
        
        return $this->getUrlToTheAssetLoader($cachedFile['file']);
    }
1139699
public static function getTypeInstance($type)
	{
		$type = ucfirst(strtolower($type));
		if (!isset(self::$instances[$type])) {
			$class = 'JFusion\\Api\\Platform\\' . $type;
			self::$instances[$type] = new $class();
		}
		return self::$instances[$type];
	}
1266588
public function locateAsset($asset)
    {
        if (substr($asset, 0, strlen($this->prefix)) === $this->prefix) {
            $locatedAsset = $this->resolveAlias($asset);
        } else {
            $locatedAsset = $asset;
        }

        if (!file_exists($locatedAsset)) {
            throw new AssetNotFoundException(sprintf('Asset not found (%s, resolved to %s)', $asset, $locatedAsset));
        }

        return $locatedAsset;
    }
6374
public function content($type)
	{
		$assets = array();
		
		foreach ($this->assets as $asset) {
			if ('style' == $type && 'css' !== $asset['ext'] && 'less' !== $asset['ext']) {
				continue;
			}
			else if ('script' == $type && 'js' !== $asset['ext']) {
				continue;
			}
			
			$assets[] = $this->process($asset);
		}
		
		if (empty($assets)) {
			return '';
		}
		
		if (count($assets) > 1 || $this->minify) {
			$assets = $this->combine($assets, $type);
		}
		
		$content = array();
		
		foreach ($assets as $asset) {
			$content[] = File::get(array_get($asset, 'path'));
		}
		
		return implode("\n\n", $content);
	}
6558
private function cacheAsset(AssetInterface $asset)
    {
    	return $this->configuration->getCacheEnabled()
    	? new AssetCache($asset, new FilesystemCache($this->configuration->getCachePath()))
    	: $asset;
    }
867681
private function addAsset (Asset $asset) : Asset
    {
        $storage = $this->locator->get(AssetStorage::class);
        $cache = $this->locator->get(AssetsCache::class);

        $asset = $storage->import($asset);
        $cache->add($asset);

        return $asset;
    }
1316110
protected static function _assets($type = null) {
		$assets = static::$_assets + [
			'js' => ['suffix' => '.js', 'filter' => null, 'paths' => [
				'{:base}/{:library}/js/{:path}' => ['base', 'library', 'path'],
				'{:base}/js/{:path}' => ['base', 'path']
			]],
			'css' => ['suffix' => '.css', 'filter' => null, 'paths' => [
				'{:base}/{:library}/css/{:path}' => ['base', 'library', 'path'],
				'{:base}/css/{:path}' => ['base', 'path']
			]],
			'image' => ['suffix' => null, 'filter' => null, 'paths' => [
				'{:base}/{:library}/img/{:path}' => ['base', 'library', 'path'],
				'{:base}/img/{:path}' => ['base', 'path']
			]],
			'generic' => ['suffix' => null, 'filter' => null, 'paths' => [
				'{:base}/{:library}/{:path}' => ['base', 'library', 'path'],
				'{:base}/{:path}' => ['base', 'path']
			]]
		];
		if ($type) {
			return isset($assets[$type]) ? $assets[$type] : null;
		}
		return $assets;
	}
883933
public function getImageUrl($type = ''): string
    {
        if ($this->getMedia()->isEmpty()) {
            return asset('assets/back/img/other.png');
        }
        $extension = $this->getExtensionType();
        if ($extension === 'image') {
            return $this->getFileUrl($type);
        } elseif ($extension) {
            return asset('assets/back/img/'.$extension.'.png');
        }

        return asset('assets/back/img/other.png');
    }
1236570
public function getAssetClassname($alias)
    {
        if (empty($this->_assets[$alias])) {
            throw new Exception("Asset '{$alias}' not found in configuration of module " . static::className());
        }
        return $this->_assets[$alias];
    }
157683
public function getEmbeddedAsset(Asset $asset)
	{
		$embeddedAsset = null;

		if ($asset->kind === Asset::KIND_JSON)
		{
			try
			{
				// Note - 2018-05-09
				// As of Craft 3.0.6 this can be replaced with $asset->getContents()
				// This version was released on 2018-05-08 so need to wait for majority adoption
				$fileContents = stream_get_contents($asset->getStream());
				$decodedJson = Json::decodeIfJson($fileContents);

				if (is_array($decodedJson))
				{
					$embeddedAsset = $this->createEmbeddedAsset($decodedJson);
				}
			}
			catch (Exception $e)
			{
				// Ignore errors and assume it's not an embedded asset
				$embeddedAsset = null;
			}
		}

		return $embeddedAsset;
	}
1194435
public function getAsseticCollection($type = null)
    {
        list($cssFiles, $jsFiles) = $this->getAssets();
        return $this->filterAssetArray(array(
            $this->createAsseticCollection($cssFiles),
            $this->createAsseticCollection($jsFiles)
        ), $type);
    }
324983
public function getAssetFilesCacheManager()
    {
        if (!$this->assetFilesCacheManager instanceof \AssetsBundle\AssetFile\AssetFilesCacheManager) {
            $this->setAssetFilesCacheManager(new \AssetsBundle\AssetFile\AssetFilesCacheManager());
        }
        return $this->assetFilesCacheManager;
    }
784217
public function displayAssetType($type)
    {
        $files = $this->assetManager->getAssetFiles($type);

        // If there are no files for the given type return here.
        if ($files === false) {
            return;
        }
        
        if ($this->combineAssets) {
            $this->displayCombinedAssets($type, $files);
        } else {
            foreach ($files as $file) {
                $cachedFile = $this->generateCachedFile($type, $file->getFileName());
                
                if ($cachedFile !== false) {
                    echo $this->generateHtmlCode($type, $cachedFile['file']);
                }
            }
        }
    }
615809
protected function getAsset($assetData)
    {
        try {
            $Comet = \CometPHP\Comet::getInstance();
        } catch (\CometPHP\Exceptions\CometNotBooted $e) {
            return null;
        }

        if (! is_array($assetData)) {
            $assetData = [$assetData];
        }

        $asset = $Comet['template']->getFunction('asset')->call(
            $this->template,
            $assetData
        );

        return $asset;
    }
527955
public function assetPath($source, $type = null)
    {
        $ext  = FS::ext($source);
        $type = (empty($type)) ? $ext : $type;

        $path = FS::clean(WWW_ROOT . '/' . $source, '/');
        if (FS::isFile($path)) {
            return $path;
        }

        $path = FS::clean(WWW_ROOT . '/' . $type . '/' . $source, '/');
        if (FS::isFile($path)) {
            return $path;
        }

        $path = $this->_findPluginAsset($source, $type);

        return $path;
    }
538281
public function returnType($type = null)
  {
    if (null === $type)
    {
      return $this->responseConfig['returnType'];
    }

    $this->responseConfig['returnType'] = $type;

    return $this;
  }