API16

API16:JObject/getProperties

From Joomla! Documentation

Revision as of 01:56, 25 March 2017 by JoomlaWikiBot (talk | contribs) (preparing for archive only)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

Returns an associative array of object properties.



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



Examples

Code Examples