Actions

API15

JObject

From Joomla! Documentation

Revision as of 17:11, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

[Edit Descripton] JObject is a generic object class. It provides:

  • Joomla 1.5 a mechanism that allows __construct() in PHP4;
  • operations for creating and accessing arbitrary object variables;
  • an array for storing errors (ordinary strings or JException objects) and operations for working with them.

Contents

Defined in

libraries/joomla/base/object.php

Methods

Method name Description
JObject A hack to support __construct() on PHP 4
__construct Class constructor, overridden in descendant classes.
get Returns a property of the object or the default value if the property is not set.
getProperties Returns an associative array of object properties
getError Get the most recent error message
getErrors Return all errors, if any
set Modifies a property of the object, creating it if it does not already exist.
setProperties Set the object properties based on a named array/hash
setError Add an error message
toString Object-to-string conversion. Each class can override it as necessary.
getPublicProperties Legacy Method, use JObject::getProperties() instead

Importing

jimport( 'joomla.base.object' );

[Edit See Also] SeeAlso:JObject

Examples

<CodeExamplesForm />

Example

$bunny = new JObject;
$bunny->set('animalType', 'hare');
$bunny->set('color', 'white');
$bunny->set('ears', 2);
 
$wolfy = new JObject;
$wolfy->setProperties(
                     array(
                           'animalType'=>'wolf',
                           'color'=>'grey',
                           'teeth'=>42,
                           'stomach'=>null
                           )
                     );
 
 
$wolfy->stomach = $bunny;
 
print_r($wolfy);

would output

JObject Object
(
    [_errors] => Array
        (
        )

    [animalType] => wolf
    [color] => grey
    [teeth] => 42
    [stomach] => JObject Object
        (
            [_errors] => Array
                (
                )

            [animalType] => hare
            [color] => white
            [ears] => 2
        )

)

This example was originally provided by Artyom.


Chris Davenport 04:43, 17 April 2011 (CDT) Edit comment

[Edit Descripton] JObject is a generic object class. It provides:

  • Joomla 1.5 a mechanism that allows __construct() in PHP4;
  • operations for creating and accessing arbitrary object variables;
  • an array for storing errors (ordinary strings or JException objects) and operations for working with them.

Defined in

libraries/joomla/base/object.php

Methods

Method name Description
__construct Class constructor, overridden in descendant classes.
__toString Magic method to convert the object to a string gracefully.
def Sets a default value if not alreay assigned
get Returns a property of the object or the default value if the property is not set.
getProperties Returns an associative array of object properties.
getError Get the most recent error message.
getErrors Return all errors, if any.
set Modifies a property of the object, creating it if it does not already exist.
setProperties Set the object properties based on a named array/hash.
setError Add an error message.
toString Deprecated1.6 - Jun 24, 2009 __toString()

Importing

jimport( 'joomla.base.object' );

[Edit See Also] SeeAlso:JObject

Examples

<CodeExamplesForm />

Example

$bunny = new JObject;
$bunny->set('animalType', 'hare');
$bunny->set('color', 'white');
$bunny->set('ears', 2);
 
$wolfy = new JObject;
$wolfy->setProperties(
                     array(
                           'animalType'=>'wolf',
                           'color'=>'grey',
                           'teeth'=>42,
                           'stomach'=>null
                           )
                     );
 
 
$wolfy->stomach = $bunny;
 
print_r($wolfy);

would output

JObject Object
(
    [_errors] => Array
        (
        )

    [animalType] => wolf
    [color] => grey
    [teeth] => 42
    [stomach] => JObject Object
        (
            [_errors] => Array
                (
                )

            [animalType] => hare
            [color] => white
            [ears] => 2
        )

)

This example was originally provided by Artyom.


Chris Davenport 04:43, 17 April 2011 (CDT) Edit comment

[Edit Descripton] JObject is a generic object class. It provides:

  • Joomla 1.5 a mechanism that allows __construct() in PHP4;
  • operations for creating and accessing arbitrary object variables;
  • an array for storing errors (ordinary strings or JException objects) and operations for working with them.

Defined in

libraries/joomla/base/object.php

Methods

Method name Description
__construct Class constructor, overridden in descendant classes.
__toString Magic method to convert the object to a string gracefully.
def Sets a default value if not alreay assigned
get Returns a property of the object or the default value if the property is not set.
getProperties Returns an associative array of object properties.
getError Get the most recent error message.
getErrors Return all errors, if any.
set Modifies a property of the object, creating it if it does not already exist.
setProperties Set the object properties based on a named array/hash.
setError Add an error message.
toString Deprecated1.6 - Jun 24, 2009 __toString()

Importing

jimport( 'joomla.base.object' );

[Edit See Also] SeeAlso:JObject

Examples

<CodeExamplesForm />

Example

$bunny = new JObject;
$bunny->set('animalType', 'hare');
$bunny->set('color', 'white');
$bunny->set('ears', 2);
 
$wolfy = new JObject;
$wolfy->setProperties(
                     array(
                           'animalType'=>'wolf',
                           'color'=>'grey',
                           'teeth'=>42,
                           'stomach'=>null
                           )
                     );
 
 
$wolfy->stomach = $bunny;
 
print_r($wolfy);

would output

JObject Object
(
    [_errors] => Array
        (
        )

    [animalType] => wolf
    [color] => grey
    [teeth] => 42
    [stomach] => JObject Object
        (
            [_errors] => Array
                (
                )

            [animalType] => hare
            [color] => white
            [ears] => 2
        )

)

This example was originally provided by Artyom.


Chris Davenport 04:43, 17 April 2011 (CDT) Edit comment

[Edit Descripton] JObject is a generic object class. It provides:

  • Joomla 1.5 a mechanism that allows __construct() in PHP4;
  • operations for creating and accessing arbitrary object variables;
  • an array for storing errors (ordinary strings or JException objects) and operations for working with them.

Defined in

libraries/joomla/base/object.php

Methods

Method name Description
__construct Class constructor, overridden in descendant classes.
__toString Magic method to convert the object to a string gracefully.
def Sets a default value if not alreay assigned
get Returns a property of the object or the default value if the property is not set.
getProperties Returns an associative array of object properties.
getError Get the most recent error message.
getErrors Return all errors, if any.
set Modifies a property of the object, creating it if it does not already exist.
setProperties Set the object properties based on a named array/hash.
setError Add an error message.
toString Deprecated1.6 - Jun 24, 2009 __toString()

Importing

jimport( 'joomla.base.object' );

[Edit See Also] SeeAlso:JObject

Examples

<CodeExamplesForm />

Example

$bunny = new JObject;
$bunny->set('animalType', 'hare');
$bunny->set('color', 'white');
$bunny->set('ears', 2);
 
$wolfy = new JObject;
$wolfy->setProperties(
                     array(
                           'animalType'=>'wolf',
                           'color'=>'grey',
                           'teeth'=>42,
                           'stomach'=>null
                           )
                     );
 
 
$wolfy->stomach = $bunny;
 
print_r($wolfy);

would output

JObject Object
(
    [_errors] => Array
        (
        )

    [animalType] => wolf
    [color] => grey
    [teeth] => 42
    [stomach] => JObject Object
        (
            [_errors] => Array
                (
                )

            [animalType] => hare
            [color] => white
            [ears] => 2
        )

)

This example was originally provided by Artyom.


Chris Davenport 04:43, 17 April 2011 (CDT) Edit comment

[Edit Descripton] JObject is a generic object class. It provides:

  • Joomla 1.5 a mechanism that allows __construct() in PHP4;
  • operations for creating and accessing arbitrary object variables;
  • an array for storing errors (ordinary strings or JException objects) and operations for working with them.

Defined in

libraries/joomla/base/object.php

Methods

Method name Description
__construct Class constructor, overridden in descendant classes.
__toString Magic method to convert the object to a string gracefully.
def Sets a default value if not alreay assigned
get Returns a property of the object or the default value if the property is not set.
getProperties Returns an associative array of object properties.
getError Get the most recent error message.
getErrors Return all errors, if any.
set Modifies a property of the object, creating it if it does not already exist.
setProperties Set the object properties based on a named array/hash.
setError Add an error message.
toString Deprecated1.6 - Jun 24, 2009 __toString()

Importing

jimport( 'joomla.base.object' );

[Edit See Also] SeeAlso:JObject

Examples

<CodeExamplesForm />

Example

$bunny = new JObject;
$bunny->set('animalType', 'hare');
$bunny->set('color', 'white');
$bunny->set('ears', 2);
 
$wolfy = new JObject;
$wolfy->setProperties(
                     array(
                           'animalType'=>'wolf',
                           'color'=>'grey',
                           'teeth'=>42,
                           'stomach'=>null
                           )
                     );
 
 
$wolfy->stomach = $bunny;
 
print_r($wolfy);

would output

JObject Object
(
    [_errors] => Array
        (
        )

    [animalType] => wolf
    [color] => grey
    [teeth] => 42
    [stomach] => JObject Object
        (
            [_errors] => Array
                (
                )

            [animalType] => hare
            [color] => white
            [ears] => 2
        )

)

This example was originally provided by Artyom.


Chris Davenport 04:43, 17 April 2011 (CDT) Edit comment

[Edit Descripton] JObject is a generic object class. It provides:

  • Joomla 1.5 a mechanism that allows __construct() in PHP4;
  • operations for creating and accessing arbitrary object variables;
  • an array for storing errors (ordinary strings or JException objects) and operations for working with them.

Defined in

libraries/joomla/base/object.php

Methods

Method name Description
__construct Class constructor, overridden in descendant classes.
__toString Magic method to convert the object to a string gracefully.
def Sets a default value if not alreay assigned
get Returns a property of the object or the default value if the property is not set.
getProperties Returns an associative array of object properties.
getError Get the most recent error message.
getErrors Return all errors, if any.
set Modifies a property of the object, creating it if it does not already exist.
setProperties Set the object properties based on a named array/hash.
setError Add an error message.
toString Deprecated1.6 - Jun 24, 2009 __toString()

Importing

jimport( 'joomla.base.object' );

[Edit See Also] SeeAlso:JObject

Examples

<CodeExamplesForm />

Example

$bunny = new JObject;
$bunny->set('animalType', 'hare');
$bunny->set('color', 'white');
$bunny->set('ears', 2);
 
$wolfy = new JObject;
$wolfy->setProperties(
                     array(
                           'animalType'=>'wolf',
                           'color'=>'grey',
                           'teeth'=>42,
                           'stomach'=>null
                           )
                     );
 
 
$wolfy->stomach = $bunny;
 
print_r($wolfy);

would output

JObject Object
(
    [_errors] => Array
        (
        )

    [animalType] => wolf
    [color] => grey
    [teeth] => 42
    [stomach] => JObject Object
        (
            [_errors] => Array
                (
                )

            [animalType] => hare
            [color] => white
            [ears] => 2
        )

)

This example was originally provided by Artyom.


Chris Davenport 04:43, 17 April 2011 (CDT) Edit comment

[Edit Descripton] JObject is a generic object class. It provides:

  • Joomla 1.5 a mechanism that allows __construct() in PHP4;
  • operations for creating and accessing arbitrary object variables;
  • an array for storing errors (ordinary strings or JException objects) and operations for working with them.

Defined in

libraries/joomla/base/object.php

Methods

Method name Description
__construct Class constructor, overridden in descendant classes.
__toString Magic method to convert the object to a string gracefully.
def Sets a default value if not alreay assigned
get Returns a property of the object or the default value if the property is not set.
getProperties Returns an associative array of object properties.
getError Get the most recent error message.
getErrors Return all errors, if any.
set Modifies a property of the object, creating it if it does not already exist.
setProperties Set the object properties based on a named array/hash.
setError Add an error message.
toString Deprecated1.6 - Jun 24, 2009 __toString()

Importing

jimport( 'joomla.base.object' );

[Edit See Also] SeeAlso:JObject

Examples

<CodeExamplesForm />

Example

$bunny = new JObject;
$bunny->set('animalType', 'hare');
$bunny->set('color', 'white');
$bunny->set('ears', 2);
 
$wolfy = new JObject;
$wolfy->setProperties(
                     array(
                           'animalType'=>'wolf',
                           'color'=>'grey',
                           'teeth'=>42,
                           'stomach'=>null
                           )
                     );
 
 
$wolfy->stomach = $bunny;
 
print_r($wolfy);

would output

JObject Object
(
    [_errors] => Array
        (
        )

    [animalType] => wolf
    [color] => grey
    [teeth] => 42
    [stomach] => JObject Object
        (
            [_errors] => Array
                (
                )

            [animalType] => hare
            [color] => white
            [ears] => 2
        )

)

This example was originally provided by Artyom.


Chris Davenport 04:43, 17 April 2011 (CDT) Edit comment

[Edit Descripton] JObject is a generic object class. It provides:

  • Joomla 1.5 a mechanism that allows __construct() in PHP4;
  • operations for creating and accessing arbitrary object variables;
  • an array for storing errors (ordinary strings or JException objects) and operations for working with them.

Defined in

libraries/joomla/base/object.php

Methods

Method name Description
__construct Class constructor, overridden in descendant classes.
__toString Magic method to convert the object to a string gracefully.
def Sets a default value if not alreay assigned
get Returns a property of the object or the default value if the property is not set.
getProperties Returns an associative array of object properties.
getError Get the most recent error message.
getErrors Return all errors, if any.
set Modifies a property of the object, creating it if it does not already exist.
setProperties Set the object properties based on a named array/hash.
setError Add an error message.
toString Deprecated1.6 - Jun 24, 2009 __toString()

Importing

jimport( 'joomla.base.object' );

[Edit See Also] SeeAlso:JObject

Examples

<CodeExamplesForm />

Example

$bunny = new JObject;
$bunny->set('animalType', 'hare');
$bunny->set('color', 'white');
$bunny->set('ears', 2);
 
$wolfy = new JObject;
$wolfy->setProperties(
                     array(
                           'animalType'=>'wolf',
                           'color'=>'grey',
                           'teeth'=>42,
                           'stomach'=>null
                           )
                     );
 
 
$wolfy->stomach = $bunny;
 
print_r($wolfy);

would output

JObject Object
(
    [_errors] => Array
        (
        )

    [animalType] => wolf
    [color] => grey
    [teeth] => 42
    [stomach] => JObject Object
        (
            [_errors] => Array
                (
                )

            [animalType] => hare
            [color] => white
            [ears] => 2
        )

)

This example was originally provided by Artyom.


Chris Davenport 04:43, 17 April 2011 (CDT) Edit comment

[Edit Descripton] JObject is a generic object class. It provides:

  • Joomla 1.5 a mechanism that allows __construct() in PHP4;
  • operations for creating and accessing arbitrary object variables;
  • an array for storing errors (ordinary strings or JException objects) and operations for working with them.

Defined in

libraries/joomla/base/object.php

Methods

Method name Description
__construct Class constructor, overridden in descendant classes.
__toString Magic method to convert the object to a string gracefully.
def Sets a default value if not alreay assigned
get Returns a property of the object or the default value if the property is not set.
getProperties Returns an associative array of object properties.
getError Get the most recent error message.
getErrors Return all errors, if any.
set Modifies a property of the object, creating it if it does not already exist.
setProperties Set the object properties based on a named array/hash.
setError Add an error message.
toString Deprecated1.6 - Jun 24, 2009 __toString()

Importing

jimport( 'joomla.base.object' );

[Edit See Also] SeeAlso:JObject

Examples

<CodeExamplesForm />

Example

$bunny = new JObject;
$bunny->set('animalType', 'hare');
$bunny->set('color', 'white');
$bunny->set('ears', 2);
 
$wolfy = new JObject;
$wolfy->setProperties(
                     array(
                           'animalType'=>'wolf',
                           'color'=>'grey',
                           'teeth'=>42,
                           'stomach'=>null
                           )
                     );
 
 
$wolfy->stomach = $bunny;
 
print_r($wolfy);

would output

JObject Object
(
    [_errors] => Array
        (
        )

    [animalType] => wolf
    [color] => grey
    [teeth] => 42
    [stomach] => JObject Object
        (
            [_errors] => Array
                (
                )

            [animalType] => hare
            [color] => white
            [ears] => 2
        )

)

This example was originally provided by Artyom.


Chris Davenport 04:43, 17 April 2011 (CDT) Edit comment

[Edit Descripton] JObject is a generic object class. It provides:

  • Joomla 1.5 a mechanism that allows __construct() in PHP4;
  • operations for creating and accessing arbitrary object variables;
  • an array for storing errors (ordinary strings or JException objects) and operations for working with them.

Defined in

libraries/joomla/base/object.php

Methods

Method name Description
__construct Class constructor, overridden in descendant classes.
__toString Magic method to convert the object to a string gracefully.
def Sets a default value if not alreay assigned
get Returns a property of the object or the default value if the property is not set.
getProperties Returns an associative array of object properties.
getError Get the most recent error message.
getErrors Return all errors, if any.
set Modifies a property of the object, creating it if it does not already exist.
setProperties Set the object properties based on a named array/hash.
setError Add an error message.
toString Deprecated1.6 - Jun 24, 2009 __toString()

Importing

jimport( 'joomla.base.object' );

[Edit See Also] SeeAlso:JObject

Examples

<CodeExamplesForm />

Example

$bunny = new JObject;
$bunny->set('animalType', 'hare');
$bunny->set('color', 'white');
$bunny->set('ears', 2);
 
$wolfy = new JObject;
$wolfy->setProperties(
                     array(
                           'animalType'=>'wolf',
                           'color'=>'grey',
                           'teeth'=>42,
                           'stomach'=>null
                           )
                     );
 
 
$wolfy->stomach = $bunny;
 
print_r($wolfy);

would output

JObject Object
(
    [_errors] => Array
        (
        )

    [animalType] => wolf
    [color] => grey
    [teeth] => 42
    [stomach] => JObject Object
        (
            [_errors] => Array
                (
                )

            [animalType] => hare
            [color] => white
            [ears] => 2
        )

)

This example was originally provided by Artyom.


Chris Davenport 04:43, 17 April 2011 (CDT) Edit comment

[Edit Descripton] JObject is a generic object class. It provides:

  • Joomla 1.5 a mechanism that allows __construct() in PHP4;
  • operations for creating and accessing arbitrary object variables;
  • an array for storing errors (ordinary strings or JException objects) and operations for working with them.

Defined in

libraries/joomla/base/object.php

Methods

Method name Description
__construct Class constructor, overridden in descendant classes.
__toString Magic method to convert the object to a string gracefully.
def Sets a default value if not alreay assigned
get Returns a property of the object or the default value if the property is not set.
getProperties Returns an associative array of object properties.
getError Get the most recent error message.
getErrors Return all errors, if any.
set Modifies a property of the object, creating it if it does not already exist.
setProperties Set the object properties based on a named array/hash.
setError Add an error message.
toString Deprecated1.6 - Jun 24, 2009 __toString()

Importing

jimport( 'joomla.base.object' );

[Edit See Also] SeeAlso:JObject

Examples

<CodeExamplesForm />

Example

$bunny = new JObject;
$bunny->set('animalType', 'hare');
$bunny->set('color', 'white');
$bunny->set('ears', 2);
 
$wolfy = new JObject;
$wolfy->setProperties(
                     array(
                           'animalType'=>'wolf',
                           'color'=>'grey',
                           'teeth'=>42,
                           'stomach'=>null
                           )
                     );
 
 
$wolfy->stomach = $bunny;
 
print_r($wolfy);

would output

JObject Object
(
    [_errors] => Array
        (
        )

    [animalType] => wolf
    [color] => grey
    [teeth] => 42
    [stomach] => JObject Object
        (
            [_errors] => Array
                (
                )

            [animalType] => hare
            [color] => white
            [ears] => 2
        )

)

This example was originally provided by Artyom.


Chris Davenport 04:43, 17 April 2011 (CDT) Edit comment

[Edit Descripton] JObject is a generic object class. It provides:

  • Joomla 1.5 a mechanism that allows __construct() in PHP4;
  • operations for creating and accessing arbitrary object variables;
  • an array for storing errors (ordinary strings or JException objects) and operations for working with them.

Defined in

libraries/joomla/base/object.php

Methods

Method name Description
__construct Class constructor, overridden in descendant classes.
__toString Magic method to convert the object to a string gracefully.
def Sets a default value if not alreay assigned
get Returns a property of the object or the default value if the property is not set.
getProperties Returns an associative array of object properties.
getError Get the most recent error message.
getErrors Return all errors, if any.
set Modifies a property of the object, creating it if it does not already exist.
setProperties Set the object properties based on a named array/hash.
setError Add an error message.
toString Deprecated1.6 - Jun 24, 2009 __toString()

Importing

jimport( 'joomla.base.object' );

[Edit See Also] SeeAlso:JObject

Examples

<CodeExamplesForm />

Example

$bunny = new JObject;
$bunny->set('animalType', 'hare');
$bunny->set('color', 'white');
$bunny->set('ears', 2);
 
$wolfy = new JObject;
$wolfy->setProperties(
                     array(
                           'animalType'=>'wolf',
                           'color'=>'grey',
                           'teeth'=>42,
                           'stomach'=>null
                           )
                     );
 
 
$wolfy->stomach = $bunny;
 
print_r($wolfy);

would output

JObject Object
(
    [_errors] => Array
        (
        )

    [animalType] => wolf
    [color] => grey
    [teeth] => 42
    [stomach] => JObject Object
        (
            [_errors] => Array
                (
                )

            [animalType] => hare
            [color] => white
            [ears] => 2
        )

)

This example was originally provided by Artyom.


Chris Davenport 04:43, 17 April 2011 (CDT) Edit comment

[Edit Descripton] JObject is a generic object class. It provides:

  • Joomla 1.5 a mechanism that allows __construct() in PHP4;
  • operations for creating and accessing arbitrary object variables;
  • an array for storing errors (ordinary strings or JException objects) and operations for working with them.

Defined in

libraries/joomla/base/object.php

Methods

Method name Description
__construct Class constructor, overridden in descendant classes.
__toString Magic method to convert the object to a string gracefully.
def Sets a default value if not alreay assigned
get Returns a property of the object or the default value if the property is not set.
getProperties Returns an associative array of object properties.
getError Get the most recent error message.
getErrors Return all errors, if any.
set Modifies a property of the object, creating it if it does not already exist.
setProperties Set the object properties based on a named array/hash.
setError Add an error message.
toString Deprecated1.6 - Jun 24, 2009 __toString()

Importing

jimport( 'joomla.base.object' );

[Edit See Also] SeeAlso:JObject

Examples

<CodeExamplesForm />

Example

$bunny = new JObject;
$bunny->set('animalType', 'hare');
$bunny->set('color', 'white');
$bunny->set('ears', 2);
 
$wolfy = new JObject;
$wolfy->setProperties(
                     array(
                           'animalType'=>'wolf',
                           'color'=>'grey',
                           'teeth'=>42,
                           'stomach'=>null
                           )
                     );
 
 
$wolfy->stomach = $bunny;
 
print_r($wolfy);

would output

JObject Object
(
    [_errors] => Array
        (
        )

    [animalType] => wolf
    [color] => grey
    [teeth] => 42
    [stomach] => JObject Object
        (
            [_errors] => Array
                (
                )

            [animalType] => hare
            [color] => white
            [ears] => 2
        )

)

This example was originally provided by Artyom.


Chris Davenport 04:43, 17 April 2011 (CDT) Edit comment

[Edit Descripton] JObject is a generic object class. It provides:

  • Joomla 1.5 a mechanism that allows __construct() in PHP4;
  • operations for creating and accessing arbitrary object variables;
  • an array for storing errors (ordinary strings or JException objects) and operations for working with them.

Defined in

libraries/joomla/base/object.php

Methods

Method name Description
__construct Class constructor, overridden in descendant classes.
__toString Magic method to convert the object to a string gracefully.
def Sets a default value if not alreay assigned
get Returns a property of the object or the default value if the property is not set.
getProperties Returns an associative array of object properties.
getError Get the most recent error message.
getErrors Return all errors, if any.
set Modifies a property of the object, creating it if it does not already exist.
setProperties Set the object properties based on a named array/hash.
setError Add an error message.
toString Deprecated1.6 - Jun 24, 2009 __toString()

Importing

jimport( 'joomla.base.object' );

[Edit See Also] SeeAlso:JObject

Examples

<CodeExamplesForm />

Example

$bunny = new JObject;
$bunny->set('animalType', 'hare');
$bunny->set('color', 'white');
$bunny->set('ears', 2);
 
$wolfy = new JObject;
$wolfy->setProperties(
                     array(
                           'animalType'=>'wolf',
                           'color'=>'grey',
                           'teeth'=>42,
                           'stomach'=>null
                           )
                     );
 
 
$wolfy->stomach = $bunny;
 
print_r($wolfy);

would output

JObject Object
(
    [_errors] => Array
        (
        )

    [animalType] => wolf
    [color] => grey
    [teeth] => 42
    [stomach] => JObject Object
        (
            [_errors] => Array
                (
                )

            [animalType] => hare
            [color] => white
            [ears] => 2
        )

)

This example was originally provided by Artyom.


Chris Davenport 04:43, 17 April 2011 (CDT) Edit comment

[Edit Descripton] JObject is a generic object class. It provides:

  • Joomla 1.5 a mechanism that allows __construct() in PHP4;
  • operations for creating and accessing arbitrary object variables;
  • an array for storing errors (ordinary strings or JException objects) and operations for working with them.

Defined in

libraries/joomla/base/object.php

Methods

Method name Description
__construct Class constructor, overridden in descendant classes.
__toString Magic method to convert the object to a string gracefully.
def Sets a default value if not alreay assigned
get Returns a property of the object or the default value if the property is not set.
getProperties Returns an associative array of object properties.
getError Get the most recent error message.
getErrors Return all errors, if any.
set Modifies a property of the object, creating it if it does not already exist.
setProperties Set the object properties based on a named array/hash.
setError Add an error message.
toString Deprecated1.6 - Jun 24, 2009 __toString()

Importing

jimport( 'joomla.base.object' );

[Edit See Also] SeeAlso:JObject

Examples

<CodeExamplesForm />

Example

$bunny = new JObject;
$bunny->set('animalType', 'hare');
$bunny->set('color', 'white');
$bunny->set('ears', 2);
 
$wolfy = new JObject;
$wolfy->setProperties(
                     array(
                           'animalType'=>'wolf',
                           'color'=>'grey',
                           'teeth'=>42,
                           'stomach'=>null
                           )
                     );
 
 
$wolfy->stomach = $bunny;
 
print_r($wolfy);

would output

JObject Object
(
    [_errors] => Array
        (
        )

    [animalType] => wolf
    [color] => grey
    [teeth] => 42
    [stomach] => JObject Object
        (
            [_errors] => Array
                (
                )

            [animalType] => hare
            [color] => white
            [ears] => 2
        )

)

This example was originally provided by Artyom.


Chris Davenport 04:43, 17 April 2011 (CDT) Edit comment

[Edit Descripton] JObject is a generic object class. It provides:

  • Joomla 1.5 a mechanism that allows __construct() in PHP4;
  • operations for creating and accessing arbitrary object variables;
  • an array for storing errors (ordinary strings or JException objects) and operations for working with them.

Defined in

libraries/joomla/base/object.php

Methods

Method name Description
__construct Class constructor, overridden in descendant classes.
__toString Magic method to convert the object to a string gracefully.
def Sets a default value if not alreay assigned
get Returns a property of the object or the default value if the property is not set.
getProperties Returns an associative array of object properties.
getError Get the most recent error message.
getErrors Return all errors, if any.
set Modifies a property of the object, creating it if it does not already exist.
setProperties Set the object properties based on a named array/hash.
setError Add an error message.
toString Deprecated1.6 - Jun 24, 2009 __toString()

Importing

jimport( 'joomla.base.object' );

[Edit See Also] SeeAlso:JObject

Examples

<CodeExamplesForm />

Example

$bunny = new JObject;
$bunny->set('animalType', 'hare');
$bunny->set('color', 'white');
$bunny->set('ears', 2);
 
$wolfy = new JObject;
$wolfy->setProperties(
                     array(
                           'animalType'=>'wolf',
                           'color'=>'grey',
                           'teeth'=>42,
                           'stomach'=>null
                           )
                     );
 
 
$wolfy->stomach = $bunny;
 
print_r($wolfy);

would output

JObject Object
(
    [_errors] => Array
        (
        )

    [animalType] => wolf
    [color] => grey
    [teeth] => 42
    [stomach] => JObject Object
        (
            [_errors] => Array
                (
                )

            [animalType] => hare
            [color] => white
            [ears] => 2
        )

)

This example was originally provided by Artyom.


Chris Davenport 04:43, 17 April 2011 (CDT) Edit comment

[Edit Descripton] JObject is a generic object class. It provides:

  • Joomla 1.5 a mechanism that allows __construct() in PHP4;
  • operations for creating and accessing arbitrary object variables;
  • an array for storing errors (ordinary strings or JException objects) and operations for working with them.

Defined in

libraries/joomla/base/object.php

Methods

Method name Description
__construct Class constructor, overridden in descendant classes.
__toString Magic method to convert the object to a string gracefully.
def Sets a default value if not alreay assigned
get Returns a property of the object or the default value if the property is not set.
getProperties Returns an associative array of object properties.
getError Get the most recent error message.
getErrors Return all errors, if any.
set Modifies a property of the object, creating it if it does not already exist.
setProperties Set the object properties based on a named array/hash.
setError Add an error message.
toString Deprecated1.6 - Jun 24, 2009 __toString()

Importing

jimport( 'joomla.base.object' );

[Edit See Also] SeeAlso:JObject

Examples

<CodeExamplesForm />

Example

$bunny = new JObject;
$bunny->set('animalType', 'hare');
$bunny->set('color', 'white');
$bunny->set('ears', 2);
 
$wolfy = new JObject;
$wolfy->setProperties(
                     array(
                           'animalType'=>'wolf',
                           'color'=>'grey',
                           'teeth'=>42,
                           'stomach'=>null
                           )
                     );
 
 
$wolfy->stomach = $bunny;
 
print_r($wolfy);

would output

JObject Object
(
    [_errors] => Array
        (
        )

    [animalType] => wolf
    [color] => grey
    [teeth] => 42
    [stomach] => JObject Object
        (
            [_errors] => Array
                (
                )

            [animalType] => hare
            [color] => white
            [ears] => 2
        )

)

This example was originally provided by Artyom.


Chris Davenport 04:43, 17 April 2011 (CDT) Edit comment

[Edit Descripton] JObject is a generic object class. It provides:

  • Joomla 1.5 a mechanism that allows __construct() in PHP4;
  • operations for creating and accessing arbitrary object variables;
  • an array for storing errors (ordinary strings or JException objects) and operations for working with them.

Defined in

libraries/joomla/base/object.php

Methods

Method name Description
__construct Class constructor, overridden in descendant classes.
__toString Magic method to convert the object to a string gracefully.
def Sets a default value if not alreay assigned
get Returns a property of the object or the default value if the property is not set.
getProperties Returns an associative array of object properties.
getError Get the most recent error message.
getErrors Return all errors, if any.
set Modifies a property of the object, creating it if it does not already exist.
setProperties Set the object properties based on a named array/hash.
setError Add an error message.
toString Deprecated1.6 - Jun 24, 2009 __toString()

Importing

jimport( 'joomla.base.object' );

[Edit See Also] SeeAlso:JObject

Examples

<CodeExamplesForm />

Example

$bunny = new JObject;
$bunny->set('animalType', 'hare');
$bunny->set('color', 'white');
$bunny->set('ears', 2);
 
$wolfy = new JObject;
$wolfy->setProperties(
                     array(
                           'animalType'=>'wolf',
                           'color'=>'grey',
                           'teeth'=>42,
                           'stomach'=>null
                           )
                     );
 
 
$wolfy->stomach = $bunny;
 
print_r($wolfy);

would output

JObject Object
(
    [_errors] => Array
        (
        )

    [animalType] => wolf
    [color] => grey
    [teeth] => 42
    [stomach] => JObject Object
        (
            [_errors] => Array
                (
                )

            [animalType] => hare
            [color] => white
            [ears] => 2
        )

)

This example was originally provided by Artyom.


Chris Davenport 04:43, 17 April 2011 (CDT) Edit comment

[Edit Descripton] JObject is a generic object class. It provides:

  • Joomla 1.5 a mechanism that allows __construct() in PHP4;
  • operations for creating and accessing arbitrary object variables;
  • an array for storing errors (ordinary strings or JException objects) and operations for working with them.

Defined in

libraries/joomla/base/object.php

Methods

Method name Description
__construct Class constructor, overridden in descendant classes.
__toString Magic method to convert the object to a string gracefully.
def Sets a default value if not alreay assigned
get Returns a property of the object or the default value if the property is not set.
getProperties Returns an associative array of object properties.
getError Get the most recent error message.
getErrors Return all errors, if any.
set Modifies a property of the object, creating it if it does not already exist.
setProperties Set the object properties based on a named array/hash.
setError Add an error message.
toString Deprecated1.6 - Jun 24, 2009 __toString()

Importing

jimport( 'joomla.base.object' );

[Edit See Also] SeeAlso:JObject

Examples

<CodeExamplesForm />

Example

$bunny = new JObject;
$bunny->set('animalType', 'hare');
$bunny->set('color', 'white');
$bunny->set('ears', 2);
 
$wolfy = new JObject;
$wolfy->setProperties(
                     array(
                           'animalType'=>'wolf',
                           'color'=>'grey',
                           'teeth'=>42,
                           'stomach'=>null
                           )
                     );
 
 
$wolfy->stomach = $bunny;
 
print_r($wolfy);

would output

JObject Object
(
    [_errors] => Array
        (
        )

    [animalType] => wolf
    [color] => grey
    [teeth] => 42
    [stomach] => JObject Object
        (
            [_errors] => Array
                (
                )

            [animalType] => hare
            [color] => white
            [ears] => 2
        )

)

This example was originally provided by Artyom.


Chris Davenport 04:43, 17 April 2011 (CDT) Edit comment

[Edit Descripton] JObject is a generic object class. It provides:

  • Joomla 1.5 a mechanism that allows __construct() in PHP4;
  • operations for creating and accessing arbitrary object variables;
  • an array for storing errors (ordinary strings or JException objects) and operations for working with them.

Defined in

libraries/joomla/base/object.php

Methods

Method name Description
__construct Class constructor, overridden in descendant classes.
__toString Magic method to convert the object to a string gracefully.
def Sets a default value if not alreay assigned
get Returns a property of the object or the default value if the property is not set.
getProperties Returns an associative array of object properties.
getError Get the most recent error message.
getErrors Return all errors, if any.
set Modifies a property of the object, creating it if it does not already exist.
setProperties Set the object properties based on a named array/hash.
setError Add an error message.
toString Deprecated1.6 - Jun 24, 2009 __toString()

Importing

jimport( 'joomla.base.object' );

[Edit See Also] SeeAlso:JObject

Examples

<CodeExamplesForm />

Example

Unstrip recursion limit exceeded (20)

would output Unstrip recursion limit exceeded (20)

This example was originally provided by Artyom.


Chris Davenport 04:43, 17 April 2011 (CDT) Edit comment

[Edit Descripton] JObject is a generic object class. It provides:

  • Joomla 1.5 a mechanism that allows __construct() in PHP4;
  • operations for creating and accessing arbitrary object variables;
  • an array for storing errors (ordinary strings or JException objects) and operations for working with them.

Defined in

libraries/joomla/base/object.php

Methods

Method name Description
__construct Class constructor, overridden in descendant classes.
__toString Magic method to convert the object to a string gracefully.
def Sets a default value if not alreay assigned
get Returns a property of the object or the default value if the property is not set.
getProperties Returns an associative array of object properties.
getError Get the most recent error message.
getErrors Return all errors, if any.
set Modifies a property of the object, creating it if it does not already exist.
setProperties Set the object properties based on a named array/hash.
setError Add an error message.
toString Deprecated1.6 - Jun 24, 2009 __toString()

Importing

Unstrip recursion limit exceeded (20)

[Edit See Also] SeeAlso:JObject

Examples

<CodeExamplesForm /> Unstrip recursion limit exceeded (20)