public function getFilteredPolicy($sec, $ptype, $fieldIndex, ...$fieldValues)
    {
        $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[] = $rule;
            }
        }

        return $res;
    }
public function getFilteredPolicy($sec, $ptype, $fieldIndex, ...$fieldValues)
    {
        $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[] = $rule;
            }
        }

        return $res;
    }
public function getFilteredPolicy ( $ sec , $ ptype , $ fieldIndex , ... $ fieldValues ) { $ 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 [ ] = $ rule ; } } return $ res ; }
gets rules based on field filters from a policy.

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

@return array
gets rules based on field filters from a policy .