public function getPreset($preset_name)
    {
        if (isset($this->presets_data[$preset_name])) {
            if (!isset($this->presets_data[$preset_name]['instance'])) {
                try {
                    $this->presets_data[$preset_name]['instance'] = $this->_buildNewPreset($preset_name);
                } catch (\Exception $e) {
                    throw $e;
                }
            }
            return $this->presets_data[$preset_name]['instance'];
        } else {
            throw new \InvalidArgumentException(
                sprintf('Preset "%s" not found!', $preset_name)
            );
        }
    }
public function getPreset($preset_name)
    {
        if (isset($this->presets_data[$preset_name])) {
            if (!isset($this->presets_data[$preset_name]['instance'])) {
                try {
                    $this->presets_data[$preset_name]['instance'] = $this->_buildNewPreset($preset_name);
                } catch (\Exception $e) {
                    throw $e;
                }
            }
            return $this->presets_data[$preset_name]['instance'];
        } else {
            throw new \InvalidArgumentException(
                sprintf('Preset "%s" not found!', $preset_name)
            );
        }
    }
public function getPreset ( $ preset_name ) { if ( isset ( $ this -> presets_data [ $ preset_name ] ) ) { if ( ! isset ( $ this -> presets_data [ $ preset_name ] [ 'instance' ] ) ) { try { $ this -> presets_data [ $ preset_name ] [ 'instance' ] = $ this -> _buildNewPreset ( $ preset_name ) ; } catch ( \ Exception $ e ) { throw $ e ; } } return $ this -> presets_data [ $ preset_name ] [ 'instance' ] ; } else { throw new \ InvalidArgumentException ( sprintf ( 'Preset "%s" not found!' , $ preset_name ) ) ; } }
Get a preset instance

@param   string $preset_name
@return  \AssetsManager\Package\Preset
@throws  \InvalidArgumentException if the preset can't be found
@throws  \Exception : any caught exception
@see     self::_buildNewPreset()
Get a preset instance