LXX. Object Aggregation/Composition Functions

Varování

Toto rozšíření je EXPERIMENTÁLNÍ . Chování tohoto rozšíření , názvy funkcí a všechno ostatní , co je zde zdokumentováno , se v budoucích verzích PHP může bez ohlášení změnit . Berte to v úvahu a používejte tento modul na vlastní nebezpečí .

Úvod

Příklad 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:

Příklad 2 .






Příklady

Příklad 3 . storage_classes.inc






Příklad 4 . test_aggregation.php














Obsah
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