Query: aggregate_info
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
AGGREGATE_INFO(3) 1 AGGREGATE_INFO(3) aggregate_info - Gets aggregation information for a given objectSYNOPSISarray aggregate_info (object $object)DESCRIPTIONGets the aggregation information for the given $object.PARAMETERSo $object -RETURN VALUESReturns the aggregation information as an associative array of arrays of methods and properties. The key for the main array is the name of the aggregated class.EXAMPLESExample #1 Using aggregate_info(3) <?php class Slicer { var $vegetable; function Slicer($vegetable) { $this->vegetable = $vegetable; } function slice_it($num_cuts) { echo "Doing some simple slicing "; for ($i=0; $i < $num_cuts; $i++) { // do some slicing } } } class Dicer { var $vegetable; var $rotation_angle = 90; // degrees function Dicer($vegetable) { $this->vegetable = $vegetable; } function dice_it($num_cuts) { echo "Cutting in one direction "; for ($i=0; $i < $num_cuts; $i++) { // do some cutting } $this->rotate($this->rotation_angle); echo "Cutting in a second direction "; for ($i=0; $i < $num_cuts; $i++) { // do some more cutting } } function rotate($deg) { echo "Now rotating {$this->vegetable} {$deg} degrees "; } function _secret_super_dicing($num_cuts) { // so secret we cannot show you ;-) } } $obj = new Slicer('onion'); aggregate($obj, 'Dicer'); print_r(aggregate_info($obj)); ?> The above example will output: Array ( [dicer] => Array ( [methods] => Array ( [0] => dice_it [1] => rotate ) [properties] => Array ( [0] => rotation_angle ) ) ) As you can see, all properties and methods of the Dicer class have been aggregated into our new object, with the exception of the class constructor and the method _secret_super_dicingSEE ALSOaggregate(3), aggregate_methods(3), aggregate_methods_by_list(3), aggregate_methods_by_regexp(3), aggregate_properties(3), aggregate_prop- erties_by_list(3), aggregate_properties_by_regexp(3), deaggregate(3). PHP Documentation Group AGGREGATE_INFO(3)
Related Man Pages |
---|
get_class(3) - php |
var_export(3) - php |
aggregate_info(3) - php |
natsort(3) - php |
sqlsrv_fetch_object(3) - php |
Similar Topics in the Unix Linux Community |
---|
Cutting In Unix Question |
Cost Cutting |
Cutting edge IT software - what's out there and what do you use |
passing object to function, columns class |
Cutting strings from output of command |