ElementFactoryComponent implements IElementFactoryComponent
A configuration option for the ElementFactory, which provides a mapping from property type to element.
Essentially, for a specific type of IProperty, this will create an Element instance.
Table of Contents
$interface | Property interface | string |
---|---|---|
$elementSupplier | Supplier for creating instances of Element. | Closure |
__construct() | mixed | |
getInterface() | Retrieve the property interface name. | string |
createElement() | Create an element based on the defined property type. | IElement |
Properties
$interface
Property interface
private
string
$interface
$elementSupplier
Supplier for creating instances of Element.
private
Closure
$elementSupplier
Methods
__construct()
public
__construct(
$interface :
string
, $elementSupplier :
Closure
)
: mixed
Parameters
- $interface : string
- $elementSupplier : Closure
Creates instances of IElement based on property interface. f() : IElement
Return values
mixedgetInterface()
Retrieve the property interface name.
public
getInterface(
)
: string
This is matched against instances of IProperty. If they match, then createElement() is called.
Return values
stringcreateElement()
Create an element based on the defined property type.
public
createElement(
$prop :
IProperty
, $name :
string
, $id :
string
, $value :
string
)
: IElement
Parameters
- $prop : IProperty
- $name : string
Input name property value
- $id : string
Element id value
- $value : string
Tags
Return values
IElement —Element