original_string: protected function _prepareReference(Zend_Db_Table_Abstract $dependentTable, Zend_Db_Table_Abstract $parentTable, $ruleKey)
      {
          $parentTableName = (get_class($parentTable) === 'Zend_Db_Table') ? $parentTable->getDefinitionConfigName() : get_class($parentTable);
          $map = $dependentTable->getReference($parentTableName, $ruleKey);
  
          if (!isset($map[Zend_Db_Table_Abstract::REF_COLUMNS])) {
              $parentInfo = $parentTable->info();
              $map[Zend_Db_Table_Abstract::REF_COLUMNS] = array_values((array) $parentInfo['primary']);
          }
  
          $map[Zend_Db_Table_Abstract::COLUMNS] = (array) $map[Zend_Db_Table_Abstract::COLUMNS];
          $map[Zend_Db_Table_Abstract::REF_COLUMNS] = (array) $map[Zend_Db_Table_Abstract::REF_COLUMNS];
  
          return $map;
      }
code: protected function _prepareReference(Zend_Db_Table_Abstract $dependentTable, Zend_Db_Table_Abstract $parentTable, $ruleKey)
      {
          $parentTableName = (get_class($parentTable) === 'Zend_Db_Table') ? $parentTable->getDefinitionConfigName() : get_class($parentTable);
          $map = $dependentTable->getReference($parentTableName, $ruleKey);
  
          if (!isset($map[Zend_Db_Table_Abstract::REF_COLUMNS])) {
              $parentInfo = $parentTable->info();
              $map[Zend_Db_Table_Abstract::REF_COLUMNS] = array_values((array) $parentInfo['primary']);
          }
  
          $map[Zend_Db_Table_Abstract::COLUMNS] = (array) $map[Zend_Db_Table_Abstract::COLUMNS];
          $map[Zend_Db_Table_Abstract::REF_COLUMNS] = (array) $map[Zend_Db_Table_Abstract::REF_COLUMNS];
  
          return $map;
      }
code_tokens: protected function _prepareReference ( Zend_Db_Table_Abstract $ dependentTable , Zend_Db_Table_Abstract $ parentTable , $ ruleKey ) { $ parentTableName = ( get_class ( $ parentTable ) === 'Zend_Db_Table' ) ? $ parentTable -> getDefinitionConfigName ( ) : get_class ( $ parentTable ) ; $ map = $ dependentTable -> getReference ( $ parentTableName , $ ruleKey ) ; if ( ! isset ( $ map [ Zend_Db_Table_Abstract :: REF_COLUMNS ] ) ) { $ parentInfo = $ parentTable -> info ( ) ; $ map [ Zend_Db_Table_Abstract :: REF_COLUMNS ] = array_values ( ( array ) $ parentInfo [ 'primary' ] ) ; } $ map [ Zend_Db_Table_Abstract :: COLUMNS ] = ( array ) $ map [ Zend_Db_Table_Abstract :: COLUMNS ] ; $ map [ Zend_Db_Table_Abstract :: REF_COLUMNS ] = ( array ) $ map [ Zend_Db_Table_Abstract :: REF_COLUMNS ] ; return $ map ; }
docstring: Prepares a table reference for lookup.
  
  Ensures all reference keys are set and properly formatted.
  
  @param Zend_Db_Table_Abstract $dependentTable
  @param Zend_Db_Table_Abstract $parentTable
  @param string                 $ruleKey
  @return array
docstring_tokens: Prepares a table reference for lookup .