LXX. Object Aggregation/Composition Functions

Warnung

Diese Erweiterung ist EXPERIMENTELL . Das Verhalten dieser Erweiterung , einschließlich der Funktionsnamen , und alles Andere was hier dokumentiert ist , kann sich in zukünftigen PHP-Versionen ohne Ankündigung ändern . Seien Sie gewarnt und verwenden Sie diese Erweiterung auf eigenes Risiko .

Einführung

Beispiel 1 .




We can also associate instances at runtime by passing a reference in a constructor (or any other method), which allow us to dynamically change the association relationship between objects. We will modify the example above to illustrate this point:

Beispiel 2 .






Beispiele

Beispiel 3 . storage_classes.inc






Beispiel 4 . test_aggregation.php














Inhaltsverzeichnis
aggregate_info -- returns an associative array of the methods and properties from each class that has been aggregated to the object.
aggregate_methods_by_list -- selective dynamic class methods aggregation to an object
aggregate_methods_by_regexp -- selective class methods aggregation to an object using a regular expression
aggregate_methods -- dynamic class and object aggregation of methods
aggregate_properties_by_list -- selective dynamic class properties aggregation to an object
aggregate_properties_by_regexp -- selective class properties aggregation to an object using a regular expression
aggregate_properties -- dynamic aggregation of class properties to an object
aggregate -- dynamic class and object aggregation of methods and properties
aggregation_info -- Synonym for aggregate_info()
deaggregate -- removes the aggregated methods and properties from an object