Actions

API16

JRules/ construct

From Joomla! Documentation

< API16:JRules
Revision as of 16:34, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Constructor.

[Edit Descripton]

Description:JRules/ construct

Syntax

__construct($input= '')
Parameter Name Default Value Description
$input A JSON format string (probably from the database), or a nested array.

Defined in

libraries/joomla/access/rules.php

Importing

jimport( 'joomla.access.rules' );

Source Body

public function __construct($input = '')
{
        // Convert in input to an array.
        if (is_string($input)) {
                $input = json_decode($input, true);
        }
        else if (is_object($input)) {
                $input = (array) $input;
        }
 
        if (is_array($input))
        {
                // Top level keys represent the actions.
                foreach ($input as $action => $identities) {
                        $this->mergeAction($action, $identities);
                }
        }
}

[Edit See Also] SeeAlso:JRules/ construct

Examples

<CodeExamplesForm />