For PHP5 applications, the all of the "aggregate" function family is now in runkit.
Object Aggregation Funktionen
- aggregate_info — Gets aggregation information for a given 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 — Alias von aggregate_info
- deaggregate — Removes the aggregated methods and properties from an object
add a note User Contributed Notes Object Aggregation Funktionen - [3 notes]
kencomer at NOSPAM dot kencomer dot com ¶
7 years ago
10 years ago
It is worth noting that class association does not work, even in PHP 4.3.0 - this ability is experimental. I'm assuming it was added in for the sake of forwards-compatibilty. Use object association instead for now.
Until it is implemented, you will receieve a parse error when attempting to use it.
Related bug report: http://bugs.php.net/bug.php?id=20531
Just to prevent people posting about "why it doesn't work??", etc etc etc.
Greg Beaver firstname at chiaraquartet dot net ¶
10 years ago
If you need to serialize an object for sessions or other purposes, and want to save aggregation state, extend it from a base class such as this one, and use $this->agg/$this->unagg instead of aggregate/deaggregate
var $_aggregates = array();
$this->_aggregates[$agg] = 1;
function unagg($agg = false)
$this->_aggregates = array();