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 Descri... |
m removing red link to edit, no existant pages |
||
| Line 3: | Line 3: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
<nowiki>[< | <nowiki>[<! removed edit link to red link >]</nowiki> | ||
</span> | </span> | ||
<! removed transcluded page call, red link never existed > | |||
===Syntax=== | ===Syntax=== | ||
| Line 51: | Line 51: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
<nowiki>[< | <nowiki>[<! removed edit link to red link >]</nowiki> | ||
</span> | </span> | ||
<! removed transcluded page call, red link never existed > | |||
===Examples=== | ===Examples=== | ||
| Line 66: | Line 66: | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
[[Category:Archived pages API15]] | |||
Revision as of 18:38, 12 May 2013
Description
Returns an associative array of object properties
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
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
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;
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />