public function setAction(string $action)
    {
        if (!empty($action) && $this->policy === Rule::NOINHERIT)
            throw new Exception("Rule::NOINHERIT can not be used in combination with an action");

        $action = (string)$action;
        if ($action !== $this->action)
        {
            $validator = $this->acl->getActionValidator();
            if (null !== $validator)
            {
                if (($reason = $validator->isValid($action)) !== true)
                    throw new Exception("Action can not be validated: " . $reason);
            }
            $this->changed = true;
            $this->action = $action;
        }
    }
public function setAction(string $action)
    {
        if (!empty($action) && $this->policy === Rule::NOINHERIT)
            throw new Exception("Rule::NOINHERIT can not be used in combination with an action");

        $action = (string)$action;
        if ($action !== $this->action)
        {
            $validator = $this->acl->getActionValidator();
            if (null !== $validator)
            {
                if (($reason = $validator->isValid($action)) !== true)
                    throw new Exception("Action can not be validated: " . $reason);
            }
            $this->changed = true;
            $this->action = $action;
        }
    }
public function setAction ( string $ action ) { if ( ! empty ( $ action ) && $ this -> policy === Rule :: NOINHERIT ) throw new Exception ( "Rule::NOINHERIT can not be used in combination with an action" ) ; $ action = ( string ) $ action ; if ( $ action !== $ this -> action ) { $ validator = $ this -> acl -> getActionValidator ( ) ; if ( null !== $ validator ) { if ( ( $ reason = $ validator -> isValid ( $ action ) ) !== true ) throw new Exception ( "Action can not be validated: " . $ reason ) ; } $ this -> changed = true ; $ this -> action = $ action ; } }
Set the action on the entity
@param $action scalar The action this Rule has a policy on.
@throws Wedeto\ACL\Exception When the action is not a scalar
Set the action on the entity