JObject/getProperties: Difference between revisions
From Joomla! Documentation
New page: ===Description===
Returns an associative array of object properties.
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JObject/getProperties|Edit Descr... |
m clean up |
||
| Line 2: | Line 2: | ||
Returns an associative array of object properties. | Returns an associative array of object properties. | ||
{{Description:JObject/getProperties}} | |||
{{subst:Description:JObject/getProperties}} | |||
===Syntax=== | ===Syntax=== | ||
| Line 49: | Line 47: | ||
</source> | </source> | ||
{{subst:SeeAlso:JObject/getProperties}} | |||
{{SeeAlso:JObject/getProperties}} | |||
===Examples=== | ===Examples=== | ||
Revision as of 14:16, 24 March 2017
Description
Returns an associative array of object properties.
{{subst:Description:JObject/getProperties}}
Syntax
getProperties($public=true)
| Parameter Name | Default Value | Description |
|---|---|---|
| $public | true | $public If true, returns only the public properties. |
Returns
array
Defined in
libraries/joomla/base/object.php
Importing
jimport( 'joomla.base.object' );
Source Body
public function getProperties($public = true)
{
$vars = get_object_vars($this);
if ($public)
{
foreach ($vars as $key => $value)
{
if ('_' == substr($key, 0, 1)) {
unset($vars[$key]);
}
}
}
return $vars;
}
{{subst:SeeAlso:JObject/getProperties}}
Examples
<CodeExamplesForm />