Back to Rule class

Method __construct

public
__construct
(mixed $identities)
Constructor.
Parameters
  • mixed $identities A JSON format string (probably from the database) or a named array.
Since
  • 1.7.0
Class: Rule
Project: Joomla

Method __construct - Source code

/**
 * Constructor.
 *
 * The input array must be in the form: array(-42 => true, 3 => true, 4 => false)
 * or an equivalent JSON encoded string.
 *
 * @param   mixed  $identities  A JSON format string (probably from the database) or a named array.
 *
 * @since   1.7.0
 */
public function __construct($identities)
{
    // Convert string input to an array.
    if (\is_string($identities)) {
        $identities = json_decode($identities, true);
    }
    $this->mergeIdentities($identities);
}