A feature holding a value.

While most features are simple boolean features (see \FeaturePhp\Model\Feature), value features have a string value that may further customize product generation.

package Default
inherited_from \FeaturePhp\Model\Feature

 Methods

Creates a value feature.

__construct(\SimpleXMLElement $node, \SimpleXMLElement $parent = null, array<mixed,\SimpleXMLElement> $children = null

For the attributes "mandatory", "alternative" and "or" see \FeaturePhp\Model\ConstraintSolver.

inherited_from \FeaturePhp\Model\Feature::__construct()

Parameters

$node

\SimpleXMLElement

$parent

\SimpleXMLElement

$children

array<mixed,\SimpleXMLElement>

Creates a feature.

__construct(\SimpleXMLElement $node, \SimpleXMLElement $parent = null, array<mixed,\SimpleXMLElement> $children = null
Inherited

For the attributes "mandatory", "alternative" and "or" see \FeaturePhp\Model\ConstraintSolver.

Parameters

$node

\SimpleXMLElement

$parent

\SimpleXMLElement

$children

array<mixed,\SimpleXMLElement>

Finds a feature by its name in a list of features.

findByName(array<mixed,\FeaturePhp\Model\Feature> $features, string $featureName, boolean $permissive = false) : \FeaturePhp\Model\Feature
InheritedStatic

Permissive search ignores case and substitutes hyphens.

Parameters

$features

array<mixed,\FeaturePhp\Model\Feature>

$featureName

string

$permissive

boolean

Returns

\FeaturePhp\Model\Feature

Creates a feature from an XML node.

fromNode(\SimpleXMLElement $node, \SimpleXMLElement $parent) : \FeaturePhp\Model\Feature
InheritedStatic

Parameters

$node

\SimpleXMLElement

$parent

\SimpleXMLElement

Returns

\FeaturePhp\Model\Feature

Returns whether the feature provides an alternative choice.

getAlternative() : boolean
Inherited

Returns

boolean

Returns the feature's child features.

getChildren() : array<mixed,\SimpleXMLElement>
Inherited

Returns

array<mixed,\SimpleXMLElement>

Returns the feature's default value.

getDefaultValue() : string
inherited_from \FeaturePhp\Model\Feature::getDefaultValue()

Returns

string

Returns the feature's default value.

getDefaultValue() : string
Inherited

Returns

string

Returns the feature's description.

getDescription() : string
Inherited

Returns

string

Returns the feature's identifier.

getIdentifier() : string
Inherited

Returns

string

Returns whether the feature is mandatory.

getMandatory() : boolean
Inherited

Returns

boolean

Returns the feature's name.

getName() : string
Inherited

Returns

string

Returns whether the feature provides a choice using an inclusive or.

getOr() : boolean
Inherited

Returns

boolean

Returns the feature's parent feature.

getParent() : \SimpleXMLElement
Inherited

Returns

\SimpleXMLElement

Returns the feature's permissive name.

getPermissiveName() : string
Inherited

Returns

string

Returns whether a feature is included in a list of features.

has(array<mixed,\FeaturePhp\Model\Features> $features, \FeaturePhp\Model\Feature $feature) : boolean
InheritedStatic

Parameters

$features

array<mixed,\FeaturePhp\Model\Features>

$feature

\FeaturePhp\Model\Feature

Returns

boolean

Transforms a feature's name to a permissive name.

_getPermissiveName(string $name) : string
InheritedStatic

Parameters

$name

string

Returns

string

 Properties

 

whether the feature provides an alternative choice

$alternative : boolean

Default

 

the feature's child features, if any

$children : array<mixed,\SimpleXMLElement>

Default

 

the feature's default value, encoded as a string

$defaultValue : string

Default

 

the feature's description, if any

$description : string

Default

 

whether the feature is mandatory

$mandatory : boolean

Default

 

the feature's name

$name : string

Default

 

whether the feature provides a choice using an inclusive or

$or : boolean

Default

 

the feature's parent feature, if any

$parent : \SimpleXMLElement

Default