// even if we are interacting between a table defined in a class and a
// table via extension, ensure to persist the definition
if (($tableDefinition =
$this->_table->
getDefinition()) !== null
&& ($dependentTable->
getDefinition() == null
)) { $dependentTable->
setOptions(array
(Zend_Db_Table_Abstract::DEFINITION =>
$tableDefinition));
} if ($select === null
) { $select =
$dependentTable->
select();
} else { $select->
setTable($dependentTable);
} $map =
$this->
_prepareReference($dependentTable,
$this->
_getTable(),
$ruleKey);
for ($i = 0;
$i <
count($map[Zend_Db_Table_Abstract::COLUMNS
]); ++
$i) { $parentColumnName =
$db->
foldCase($map[Zend_Db_Table_Abstract::REF_COLUMNS
][$i]);
$value =
$this->_data
[$parentColumnName];
// Use adapter from dependent table to ensure correct query construction
$dependentDb =
$dependentTable->
getAdapter();
$dependentColumnName =
$dependentDb->
foldCase($map[Zend_Db_Table_Abstract::COLUMNS
][$i]);
$dependentColumn =
$dependentDb->
quoteIdentifier($dependentColumnName, true
);