PHP Class Sulu\Bundle\MediaBundle\Media\FormatLoader\BaseXmlFormatLoader

Inheritance: extends Symfony\Component\Config\Loader\FileLoader
Show file Open project: sulu/sulu Class Usage Examples

Protected Properties

Property Type Description
$xpath DOMXPath

Public Methods

Method Description
getGlobalOptions ( ) : array
load ( mixed $resource, string $type = null ) : array Load formats from a xml file.
setGlobalOptions ( array $globalOptions )
supports ( mixed $resource, string $type = null ) : boolean Returns true if this class supports the given resource.

Protected Methods

Method Description
getInternalFlagFromFormatNode ( DOMNode $formatNode ) : boolean For a given format node returns the internal flag of the format.
getKeyFromFormatNode ( DOMNode $formatNode ) : string For a given format node returns the key of the format.
getMetaFromFormatNode ( DOMNode $formatNode ) : array For a given format node returns the meta information of the format.
getParametersFromNode ( DOMNode $node, string $parameterName = 'parameter' ) : array For a given dom node returns an array of parameters. The xml name of the parameter tag can be passed as an argument.
getScaleFromFormatNode ( DOMNode $formatNode ) : array For a given format node returns the scale information of the format.
getTransformationsFromFormatNode ( DOMNode $formatNode ) : array For a given format node returns the transformations for it.

Private Methods

Method Description
addFormatFromFormatNode ( DOMNode $formatNode, &$formats ) For a given format node and a given array of formats, this method parses the format node to an array and adds it to the formats array.
getOptionsFromFormatNode ( DOMNode $formatNode ) : array For a given format node returns the options for it.
parseXml ( $file ) : array
tryLoad ( $file ) : DOMDocument Tries to load the DOM Document of a given image formats xml.

Method Details

getGlobalOptions() public method

public getGlobalOptions ( ) : array
return array

getInternalFlagFromFormatNode() abstract protected method

For a given format node returns the internal flag of the format.
abstract protected getInternalFlagFromFormatNode ( DOMNode $formatNode ) : boolean
$formatNode DOMNode
return boolean

getKeyFromFormatNode() abstract protected method

For a given format node returns the key of the format.
abstract protected getKeyFromFormatNode ( DOMNode $formatNode ) : string
$formatNode DOMNode
return string

getMetaFromFormatNode() abstract protected method

For a given format node returns the meta information of the format.
abstract protected getMetaFromFormatNode ( DOMNode $formatNode ) : array
$formatNode DOMNode
return array

getParametersFromNode() protected method

For a given dom node returns an array of parameters. The xml name of the parameter tag can be passed as an argument.
protected getParametersFromNode ( DOMNode $node, string $parameterName = 'parameter' ) : array
$node DOMNode
$parameterName string
return array

getScaleFromFormatNode() abstract protected method

For a given format node returns the scale information of the format.
abstract protected getScaleFromFormatNode ( DOMNode $formatNode ) : array
$formatNode DOMNode
return array

getTransformationsFromFormatNode() abstract protected method

For a given format node returns the transformations for it.
abstract protected getTransformationsFromFormatNode ( DOMNode $formatNode ) : array
$formatNode DOMNode
return array

load() public method

Load formats from a xml file.
public load ( mixed $resource, string $type = null ) : array
$resource mixed The resource
$type string The resource type
return array The formats array for the given resource

setGlobalOptions() public method

public setGlobalOptions ( array $globalOptions )
$globalOptions array

supports() public method

Returns true if this class supports the given resource.
public supports ( mixed $resource, string $type = null ) : boolean
$resource mixed A resource
$type string The resource type
return boolean true if this class supports the given resource, false otherwise

Property Details

$xpath protected property

protected DOMXPath $xpath
return DOMXPath