public function removeFilteredPolicy($sec, $ptype, $fieldIndex, ...$fieldValues)
    {
        $tmp = [];
        $res = false;

        if (!isset($this->model[$sec][$ptype])) {
            return $res;
        }

        foreach ($this->model[$sec][$ptype]->policy as $rule) {
            $matched = true;
            foreach ($fieldValues as $i => $fieldValue) {
                if ('' != $fieldValue && $rule[$fieldIndex + $i] != $fieldValue) {
                    $matched = false;

                    break;
                }
            }

            if ($matched) {
                $res = true;
            } else {
                $tmp[] = $rule;
            }
        }

        $this->model[$sec][$ptype]->policy = $tmp;

        return $res;
    }
public function removeFilteredPolicy($sec, $ptype, $fieldIndex, ...$fieldValues)
    {
        $tmp = [];
        $res = false;

        if (!isset($this->model[$sec][$ptype])) {
            return $res;
        }

        foreach ($this->model[$sec][$ptype]->policy as $rule) {
            $matched = true;
            foreach ($fieldValues as $i => $fieldValue) {
                if ('' != $fieldValue && $rule[$fieldIndex + $i] != $fieldValue) {
                    $matched = false;

                    break;
                }
            }

            if ($matched) {
                $res = true;
            } else {
                $tmp[] = $rule;
            }
        }

        $this->model[$sec][$ptype]->policy = $tmp;

        return $res;
    }
public function removeFilteredPolicy ( $ sec , $ ptype , $ fieldIndex , ... $ fieldValues ) { $ tmp = [ ] ; $ res = false ; if ( ! isset ( $ this -> model [ $ sec ] [ $ ptype ] ) ) { return $ res ; } foreach ( $ this -> model [ $ sec ] [ $ ptype ] -> policy as $ rule ) { $ matched = true ; foreach ( $ fieldValues as $ i => $ fieldValue ) { if ( '' != $ fieldValue && $ rule [ $ fieldIndex + $ i ] != $ fieldValue ) { $ matched = false ; break ; } } if ( $ matched ) { $ res = true ; } else { $ tmp [ ] = $ rule ; } } $ this -> model [ $ sec ] [ $ ptype ] -> policy = $ tmp ; return $ res ; }
removes policy rules based on field filters from the model.

@param string $sec
@param string $ptype
@param int    $fieldIndex
@param mixed  ...$fieldValues

@return bool
removes policy rules based on field filters from the model .