API16

JObject/set: Difference between revisions

From Joomla! Documentation

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...
 
m preparing for archive only
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
Modifies a property of the object, creating it if it does not already exist.
Modifies a property of the object, creating it if it does not already exist.


<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JObject/set|Edit Descripton]]<nowiki>]</nowiki>
</span>


{{Description:JObject/set}}
 
 


===Syntax===
===Syntax===
Line 44: Line 42:
</source>
</source>


<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[SeeAlso:JObject/set|Edit See Also]]<nowiki>]</nowiki>
 
</span>
{{SeeAlso:JObject/set}}


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=set
  category=set
  category=JObject
  category=JObject
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*
  format= ,,,
  format= ,,,
</dpl>
</dpl>

Latest revision as of 01:56, 25 March 2017

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