\Cake\UtilityMergeVariablesTrait

Provides features for merging object properties recursively with parent classes.

Summary

Methods
Properties
Constants
No public methods found
No public properties found
No constants found
_mergeVars()
_mergeProperty()
_mergePropertyData()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

_mergeVars()

_mergeVars(array  $properties, array  $options = array()) : void

Merge the list of $properties with all parent classes of the current class.

Options:

  • associative - A list of properties that should be treated as associative arrays. Properties in this list will be passed through Hash::normalize() before merging.

Parameters

array $properties

An array of properties and the merge strategy for them.

array $options

The options to use when merging properties.

_mergeProperty()

_mergeProperty(string  $property, array  $parentClasses, array  $options) : void

Merge a single property with the values declared in all parent classes.

Parameters

string $property

The name of the property being merged.

array $parentClasses

An array of classes you want to merge with.

array $options

Options for merging the property, see _mergeVars()

_mergePropertyData()

_mergePropertyData(array  $current, array  $parent, boolean  $isAssoc) : mixed

Merge each of the keys in a property together.

Parameters

array $current

The current merged value.

array $parent

The parent class' value.

boolean $isAssoc

Whether or not the merging should be done in associative mode.

Returns

mixed —

The updated value.