API16

API16:JObject/set

From Joomla! Documentation

Revision as of 22:37, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Modifies a property of the object, creating it if it does not already exist. <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JObjec...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

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

[Edit Descripton]

Template:Description:JObject/set

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;
}

[Edit See Also] Template:SeeAlso:JObject/set

Examples

<CodeExamplesForm />