Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online

aggregate info function syntax tag tutorial 2013





Alert! Connect with 10,000 Chating Online. Join Now

Php aggregate info () function

Write your php code

 
<?php ?>

Php Result


Your code below



(no version information, might be only in CVS)

aggregate_info --  Returns an associative array of the methods and properties from each class that has been aggregated to the object

Syntax

array aggregate_info ( object object )

Will return the aggregation information for a particular object as an associative array of arrays of methods and properties. The key for the main array is the name of the aggregated class.

For example the code below

Example 1. Using aggregate_info()

<?php

class Slicer {
    var
$vegetable;

    function
Slicer($vegetable)
    {
        
$this->vegetable = $vegetable;
    }

    function
slice_it($num_cuts)
    {
        echo
"Doing some simple slicing\n";
        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\n";
        for (
$i=0; $i < $num_cuts; $i++) {
            
// do some cutting
        
}
        
$this->rotate($this->rotation_angle);
        echo
"Cutting in a second direction\n";
        for (
$i=0; $i < $num_cuts; $i++) {
            
// do some more cutting
        
}
    }

    function
rotate($deg)
    {
        echo
"Now rotating {$this->vegetable} {$deg} degrees\n";
    }

    function
_secret_super_dicing($num_cuts)
    {
        
// so secret we cannot show you ;-)
    
}
}

$obj = new Slicer('onion');
aggregate($obj, 'Dicer');
print_r(aggregate_info($obj));
?>

Will produce the 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_dicing

See also aggregate(), aggregate_methods(), aggregate_methods_by_list(), aggregate_methods_by_regexp(), aggregate_properties(), aggregate_properties_by_list(), aggregate_properties_by_regexp(), deaggregate()

Php aggregate info Function syntax tag

aggregate info php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online



Php aggregate info syntax tutorial

php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.


Function index

Variables

Expressions

Operators

Control-Structures

Cookies

Array

Date & Time

Directory function

File

Image

Operators

Form data handling

Mathematics operators

Mail

Php Mysql

Network Functions

Strings

php tutorial guides,functions, classes, code examples and tags for creating simple dynamic site to mysql database driven sites
 
 
Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online