Ingo_Storage::_getRule PHP Method

_getRule() protected method

Retrieves a rule.
protected _getRule ( Ingo_Rule $rule ) : integer
$rule Ingo_Rule The rule object.
return integer The key of the rule in the rules list.
    protected function _getRule(Ingo_Rule $rule)
    {
        $this->_load();
        foreach ($this->_rules as $key => $val) {
            if (strlen($rule->uid)) {
                if ($val->uid == $rule->uid) {
                    return $key;
                }
            } elseif ($rule instanceof Ingo_Rule_System && $rule instanceof $val) {
                $rule->uid = $val->uid;
                return $key;
            }
        }
        return null;
    }