Source code for file /joomla/base/object.php
Documentation is available at object.php
* @version $Id: object.php 6616 2007-02-14 00:22:01Z chrisdavenport $
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
* Object class, allowing __construct in PHP4.
* @package Joomla.Framework
* A hack to support __construct() on PHP 4
* Hint: descendant classes have no PHP4 class_name() constructors,
* so this constructor gets called first and calls the top-layer __construct()
* which (if present) should call parent::__construct()
* Class constructor, overridden in descendant classes.
* Modifies a property of the object, creating it if it does not already exist.
* @param string $property The name of the property
* @param mixed $value The value of the property to set
function set( $property, $value=
null ) {
$this->$property =
$value;
* Returns a property of the object or the default value if the property is not set.
* @param string $property The name of the property
* @param mixed $default The default value
* @return mixed The value of the property
* @see get(), getPublicProperties()
function get($property, $default=
null)
if(isset
($this->$property)) {
* Returns an array of public properties
* @param boolean $assoc If true, returns an associative key=>value array
$vars =
array(array(),array());
if (substr( $key, 0, 1 ) !=
'_')
return $vars[$assoc ?
1 :
0];
* Object-to-string conversion.
* Each class can override it as necessary.
* @return string This name of this class
* @see get(), getPublicProperties()