Trait MergeVariablesTrait
Provides features for merging object properties recursively with parent classes.
Direct Users
Indirect Users
- Cake\Controller\ErrorController
- Cake\Shell\CacheShell
- Cake\Shell\Task\AssetsTask
- Cake\Shell\Task\CommandTask
- Cake\Shell\Task\ExtractTask
- Cake\Shell\Task\LoadTask
- Cake\Shell\Task\UnloadTask
- Cake\Shell\VersionShell
- Cake\Shell\CommandListShell
- Cake\Shell\CompletionShell
- Cake\Shell\HelpShell
- Cake\Shell\I18nShell
- Cake\Shell\OrmCacheShell
- Cake\Shell\PluginShell
- Cake\Shell\RoutesShell
- Cake\Shell\ServerShell
Method Summary
- _mergeProperty() protectedMerge a single property with the values declared in all parent classes.
- _mergePropertyData() protectedMerge each of the keys in a property together.
- _mergeVars() protectedMerge the list of $properties with all parent classes of the current class.
Method Detail
_mergeProperty()source protected
_mergeProperty( string $property , array $parentClasses , array $options )
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()source protected
_mergePropertyData( array $current , array $parent , boolean $isAssoc )
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
mixedThe updated value.
_mergeVars()source protected
_mergeVars( array $properties , array $options [] )
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
optional [] - The options to use when merging properties.
© 2005–2017 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/3.4/class-Cake.Utility.MergeVariablesTrait.html