API16

API16:JObject/set

From Joomla! Documentation

Description

Modifies a property of the object, creating it if it does not already exist.



Syntax

set($property, $value=null)
Parameter Name Default Value Description
$property $property The name of the property.
$value null $value The value of the property to set.

Returns

mixed Previous value of the property.

Defined in

libraries/joomla/base/object.php

Importing

jimport( 'joomla.base.object' );

Source Body

public function set($property, $value = null)
{
        $previous = isset($this->$property) ? $this->$property : null;
        $this->$property = $value;
        return $previous;
}



Examples

Code Examples