API16

API16:JObject/set

From Joomla! Documentation

Revision as of 01:56, 25 March 2017 by JoomlaWikiBot (talk | contribs) (preparing for archive only)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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