library/Garp/Content/Manager.php
protected function _findSecondRuleKeyForHomophiles($filterModel, $bindingModel) {
        $homophileSecondRuleKey = null;

        if ($this->_isHomophile($filterModel)) {
            $bindingReferenceMap = $bindingModel->info(Zend_Db_Table_Abstract::REFERENCE_MAP);

            $foundRelevantRule = false;
            foreach ($bindingReferenceMap as $ruleKey => $rule) {
                if ($rule['refTableClass'] === get_class($this->_model)) {
                    if ($foundRelevantRule) {
                        $homophileSecondRuleKey = $ruleKey;
                    }
                    $foundRelevantRule = !$foundRelevantRule;
                }
            }
        }

        return $homophileSecondRuleKey;
    }
protected function _findSecondRuleKeyForHomophiles($filterModel, $bindingModel) {
        $homophileSecondRuleKey = null;

        if ($this->_isHomophile($filterModel)) {
            $bindingReferenceMap = $bindingModel->info(Zend_Db_Table_Abstract::REFERENCE_MAP);

            $foundRelevantRule = false;
            foreach ($bindingReferenceMap as $ruleKey => $rule) {
                if ($rule['refTableClass'] === get_class($this->_model)) {
                    if ($foundRelevantRule) {
                        $homophileSecondRuleKey = $ruleKey;
                    }
                    $foundRelevantRule = !$foundRelevantRule;
                }
            }
        }

        return $homophileSecondRuleKey;
    }
protected function _findSecondRuleKeyForHomophiles ( $ filterModel , $ bindingModel ) { $ homophileSecondRuleKey = null ; if ( $ this -> _isHomophile ( $ filterModel ) ) { $ bindingReferenceMap = $ bindingModel -> info ( Zend_Db_Table_Abstract :: REFERENCE_MAP ) ; $ foundRelevantRule = false ; foreach ( $ bindingReferenceMap as $ ruleKey => $ rule ) { if ( $ rule [ 'refTableClass' ] === get_class ( $ this -> _model ) ) { if ( $ foundRelevantRule ) { $ homophileSecondRuleKey = $ ruleKey ; } $ foundRelevantRule = ! $ foundRelevantRule ; } } } return $ homophileSecondRuleKey ; }
In case of a homophile relation, this function returns the key to the second rule,
to prevent the same rule being returned twice, because both rules in
a homophile binding model point to the same related model.

@param Garp_Model_Db $filterModel
@param string $bindingModel
@return string|null Returns the name of the second rule key in the reference map,
if this is a homophile relation. Otherwise, null is returned.
In case of a homophile relation this function returns the key to the second rule to prevent the same rule being returned twice because both rules in a homophile binding model point to the same related model .