API16

API16:JObject/getProperties

From Joomla! Documentation

Revision as of 22:37, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Returns an associative array of object properties. <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JObject/getProperties|Edit Descr...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

Returns an associative array of object properties.

[Edit Descripton]

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

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

Examples

<CodeExamplesForm />