Back to Rules class

Method mergeAction

public void
mergeAction
(mixed $action, mixed $identities)
Merges an array of identities for an action.
Parameters
  • string $action The name of the action.
  • array $identities An array of identities
Returns
  • void
Since
  • 1.7.0
Class: Rules
Project: Joomla

Method mergeAction - Source code

/**
 * Merges an array of identities for an action.
 *
 * @param   string  $action      The name of the action.
 * @param   array   $identities  An array of identities
 *
 * @return  void
 *
 * @since   1.7.0
 */
public function mergeAction($action, $identities)
{
    if (isset($this->data[$action])) {
        // If exists, merge the action.
        $this->data[$action]->mergeIdentities($identities);
    } else {
        // If new, add the action.
        $this->data[$action] = new Rule($identities);
    }
}