Back to CMSObject class

Method setProperties

public bool
setProperties
(mixed $properties)
Set the object properties based on a named array/hash.
Parameters
  • mixed $properties Either an associative array or another object.
Returns
  • bool
Since
  • 1.7.0
-
  • \Joomla\CMS\Object\CMSObject::set()
Class: CMSObject
Project: Joomla

Method setProperties - Source code

/**
 * Set the object properties based on a named array/hash.
 *
 * @param   mixed  $properties  Either an associative array or another object.
 *
 * @return  boolean
 *
 * @since   1.7.0
 *
 * @see     CMSObject::set()
 */
public function setProperties($properties)
{
    if (\is_array($properties) || \is_object($properties)) {
        foreach ((array) $properties as $k => $v) {
            // Use the set function which might be overridden.
            $this->set($k, $v);
        }
        return true;
    }
    return false;
}