PHP Class Sulu\Bundle\ContentBundle\Twig\ContentTwigExtension

Inheritance: extends Twig_Extension
Datei anzeigen Open project: sulu/sulu

Public Methods

Method Description
__construct ( $contentTypeManager )
convertParameterToKeyValue ( PropertyParameter[] $parameters ) : array
convertParameterToNamesArrays ( PropertyParameter[] $parameters ) : array
convertParameterToSelect ( PropertyParameter[] $parameters, string $locale ) : array
getFunctions ( ) : array Returns an array of possible function in this extension.
getName ( ) : string Returns the name of the extension.
getParamsFunction ( Sulu\Component\Content\Compat\PropertyInterface $property ) : array Returns parameters for given property merged wit default parameters.
getTests ( ) : array Returns an array of possible tests in this extension.
getTypeFunction ( $name ) : Sulu\Component\Content\ContentTypeInterface Returns content type with given name.
isMultipleTest ( $property ) : boolean Return if property is an array.
needsAddButtonFunction ( Sulu\Component\Content\Compat\PropertyInterface $property ) : boolean Return true if property is an array and needs an add button.

Private Methods

Method Description
mergeRecursive ( ) : array Better array merge recursive function - does not combine to scalar values to a array.

Method Details

__construct() public method

public __construct ( $contentTypeManager )

convertParameterToKeyValue() public method

public convertParameterToKeyValue ( PropertyParameter[] $parameters ) : array
$parameters Sulu\Component\Content\Compat\PropertyParameter[]
return array

convertParameterToNamesArrays() public method

public convertParameterToNamesArrays ( PropertyParameter[] $parameters ) : array
$parameters Sulu\Component\Content\Compat\PropertyParameter[]
return array

convertParameterToSelect() public method

public convertParameterToSelect ( PropertyParameter[] $parameters, string $locale ) : array
$parameters Sulu\Component\Content\Compat\PropertyParameter[]
$locale string
return array

getFunctions() public method

Returns an array of possible function in this extension.
public getFunctions ( ) : array
return array

getName() public method

Returns the name of the extension.
public getName ( ) : string
return string The extension name

getParamsFunction() public method

Returns parameters for given property merged wit default parameters.
public getParamsFunction ( Sulu\Component\Content\Compat\PropertyInterface $property ) : array
$property Sulu\Component\Content\Compat\PropertyInterface
return array

getTests() public method

Returns an array of possible tests in this extension.
public getTests ( ) : array
return array

getTypeFunction() public method

Returns content type with given name.
public getTypeFunction ( $name ) : Sulu\Component\Content\ContentTypeInterface
$name string
return Sulu\Component\Content\ContentTypeInterface

isMultipleTest() public method

Return if property is an array.
public isMultipleTest ( $property ) : boolean
$property PropertyInterface
return boolean

needsAddButtonFunction() public method

Return true if property is an array and needs an add button.
public needsAddButtonFunction ( Sulu\Component\Content\Compat\PropertyInterface $property ) : boolean
$property Sulu\Component\Content\Compat\PropertyInterface PropertyInterface
return boolean