PHP Class WellCommerce\Bundle\ThemeBundle\Generator\ThemeFieldsGenerator

Author: Adam Piotrowski ([email protected])
Inheritance: extends WellCommerce\Bundle\AppBundle\DependencyInjection\AbstractContainer, implements Symfony\Component\DependencyInjection\ContainerAwareInterface
Afficher le fichier Open project: wellcommerce/wellcommerce

Protected Properties

Свойство Type Description
$builder WellCommerce\Component\Form\FormBuilderInterface
$configuration DOMDocument
$configurationFile
$defaultValues
$form WellCommerce\Component\Form\Elements\Form
$layoutBoxSelector
$nextFieldId
$theme WellCommerce\Bundle\ThemeBundle\Entity\Theme
$themeDir

Méthodes publiques

Méthode Description
addFormFields ( WellCommerce\Component\Form\FormBuilderInterface $builder ) Adds required theme configuration fields to form
getDefaultValues ( $field ) : array Returns default values for field
loadThemeFieldsConfiguration ( Theme $theme, string $layoutBoxSelector = '.layout-box' ) Initializes generator configuration

Méthodes protégées

Méthode Description
addField ( DOMElement $field ) Resolves field type and adds it to fieldset
addFieldBackground ( DOMElement $field ) : mixed Adds background selector
addFieldFont ( DOMElement $field ) : mixed Adds font selector
addFieldHeight ( DOMElement $field ) : mixed Adds height input
addFieldWidth ( DOMElement $field ) : mixed Adds width input
addFieldset ( DOMElement $node ) Adds new configuration fieldset to form
addSizeInput ( string $type, array $attributes ) : WellCommerce\Component\Form\Elements\ElementInterface Returns text field
getFieldAttributes ( DOMElement $item ) : array Returns an array containing all required field attributes
getFieldName ( DOMElement $item ) : string Returns form name or sets it automatically
getFieldSelector ( DOMElement $item ) : mixed Returns field specific selector
getFieldTypeSuffix ( $type ) : mixed Returns field element suffix

Private Methods

Méthode Description
getDirectory ( ) : string Returns theme working directory
loadConfiguration ( ) : DOMDocument | null Loads fields configuration from fields.xml file
loadFile ( $file ) : DOMDocument Parses XML file

Method Details

addField() protected méthode

Resolves field type and adds it to fieldset
protected addField ( DOMElement $field )
$field DOMElement

addFieldBackground() protected méthode

Adds background selector
protected addFieldBackground ( DOMElement $field ) : mixed
$field DOMElement
Résultat mixed

addFieldFont() protected méthode

Adds font selector
protected addFieldFont ( DOMElement $field ) : mixed
$field DOMElement
Résultat mixed

addFieldHeight() protected méthode

Adds height input
protected addFieldHeight ( DOMElement $field ) : mixed
$field DOMElement
Résultat mixed

addFieldWidth() protected méthode

Adds width input
protected addFieldWidth ( DOMElement $field ) : mixed
$field DOMElement
Résultat mixed

addFieldset() protected méthode

Adds new configuration fieldset to form
protected addFieldset ( DOMElement $node )
$node DOMElement

addFormFields() public méthode

Adds required theme configuration fields to form
public addFormFields ( WellCommerce\Component\Form\FormBuilderInterface $builder )
$builder WellCommerce\Component\Form\FormBuilderInterface

addSizeInput() protected méthode

Returns text field
protected addSizeInput ( string $type, array $attributes ) : WellCommerce\Component\Form\Elements\ElementInterface
$type string
$attributes array
Résultat WellCommerce\Component\Form\Elements\ElementInterface

getDefaultValues() public méthode

Returns default values for field
public getDefaultValues ( $field ) : array
$field
Résultat array

getFieldAttributes() protected méthode

Returns an array containing all required field attributes
protected getFieldAttributes ( DOMElement $item ) : array
$item DOMElement
Résultat array

getFieldName() protected méthode

Returns form name or sets it automatically
protected getFieldName ( DOMElement $item ) : string
$item DOMElement
Résultat string

getFieldSelector() protected méthode

Returns field specific selector
protected getFieldSelector ( DOMElement $item ) : mixed
$item DOMElement
Résultat mixed

getFieldTypeSuffix() protected méthode

Returns field element suffix
protected getFieldTypeSuffix ( $type ) : mixed
$type
Résultat mixed

loadThemeFieldsConfiguration() public méthode

Initializes generator configuration
public loadThemeFieldsConfiguration ( Theme $theme, string $layoutBoxSelector = '.layout-box' )
$theme WellCommerce\Bundle\ThemeBundle\Entity\Theme
$layoutBoxSelector string

Property Details

$builder protected_oe property

protected FormBuilderInterface,WellCommerce\Component\Form $builder
Résultat WellCommerce\Component\Form\FormBuilderInterface

$configuration protected_oe property

protected DOMDocument $configuration
Résultat DOMDocument

$configurationFile protected_oe property

protected $configurationFile

$defaultValues protected_oe property

protected $defaultValues

$form protected_oe property

protected Form,WellCommerce\Component\Form\Elements $form
Résultat WellCommerce\Component\Form\Elements\Form

$layoutBoxSelector protected_oe property

protected $layoutBoxSelector

$nextFieldId protected_oe property

protected $nextFieldId

$theme protected_oe property

protected Theme,WellCommerce\Bundle\ThemeBundle\Entity $theme
Résultat WellCommerce\Bundle\ThemeBundle\Entity\Theme

$themeDir protected_oe property

protected $themeDir