API16

Difference between revisions of "JException/setProperties"

From Joomla! Documentation

< API16:JException
(New page: ===Description=== Set the object properties based on a named array/hash <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JException/setProperties|Edit...)
(No difference)

Revision as of 17:47, 22 March 2010

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

Set the object properties based on a named array/hash

[Edit Descripton]

Template:Description:JException/setProperties

Syntax[edit]

setProperties($properties)
Parameter Name Default Value Description
$properties mixed Either and associative array or another object

Returns[edit]

boolean

Defined in[edit]

libraries/joomla/error/exception.php

Importing[edit]

jimport( 'joomla.error.exception' );

Source Body[edit]

public function setProperties($properties)
{
        $properties = (array) $properties; //cast to an array

        if (is_array($properties))
        {
                foreach ($properties as $k => $v) {
                        $this->$k = $v;
                }

                return true;
        }

        return false;
}

[Edit See Also] Template:SeeAlso:JException/setProperties

Examples[edit]

<CodeExamplesForm />