original_string: public function findDependentRowset($dependentTable, $ruleKey = null, Zend_Db_Table_Select $select = null)
      {
          $db = $this->_getTable()->getAdapter();
  
          if (is_string($dependentTable)) {
              $dependentTable = $this->_getTableFromString($dependentTable);
          }
  
          if (!$dependentTable instanceof Zend_Db_Table_Abstract) {
              $type = gettype($dependentTable);
              if ($type == 'object') {
                  $type = get_class($dependentTable);
              }
              // require_once 'Zend/Db/Table/Row/Exception.php';
              throw new Zend_Db_Table_Row_Exception("Dependent table must be a Zend_Db_Table_Abstract, but it is $type");
          }
  
          // 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);
              $dependentInfo = $dependentTable->info();
              $type = $dependentInfo[Zend_Db_Table_Abstract::METADATA][$dependentColumnName]['DATA_TYPE'];
              $select->where("$dependentColumn = ?", $value, $type);
          }
  
          return $dependentTable->fetchAll($select);
      }
code: public function findDependentRowset($dependentTable, $ruleKey = null, Zend_Db_Table_Select $select = null)
      {
          $db = $this->_getTable()->getAdapter();
  
          if (is_string($dependentTable)) {
              $dependentTable = $this->_getTableFromString($dependentTable);
          }
  
          if (!$dependentTable instanceof Zend_Db_Table_Abstract) {
              $type = gettype($dependentTable);
              if ($type == 'object') {
                  $type = get_class($dependentTable);
              }
              // require_once 'Zend/Db/Table/Row/Exception.php';
              throw new Zend_Db_Table_Row_Exception("Dependent table must be a Zend_Db_Table_Abstract, but it is $type");
          }
  
          // 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);
              $dependentInfo = $dependentTable->info();
              $type = $dependentInfo[Zend_Db_Table_Abstract::METADATA][$dependentColumnName]['DATA_TYPE'];
              $select->where("$dependentColumn = ?", $value, $type);
          }
  
          return $dependentTable->fetchAll($select);
      }
code_tokens: public function findDependentRowset ( $ dependentTable , $ ruleKey = null , Zend_Db_Table_Select $ select = null ) { $ db = $ this -> _getTable ( ) -> getAdapter ( ) ; if ( is_string ( $ dependentTable ) ) { $ dependentTable = $ this -> _getTableFromString ( $ dependentTable ) ; } if ( ! $ dependentTable instanceof Zend_Db_Table_Abstract ) { $ type = gettype ( $ dependentTable ) ; if ( $ type == 'object' ) { $ type = get_class ( $ dependentTable ) ; } // require_once 'Zend/Db/Table/Row/Exception.php'; throw new Zend_Db_Table_Row_Exception ( "Dependent table must be a Zend_Db_Table_Abstract, but it is $type" ) ; } // 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 ) ; $ dependentInfo = $ dependentTable -> info ( ) ; $ type = $ dependentInfo [ Zend_Db_Table_Abstract :: METADATA ] [ $ dependentColumnName ] [ 'DATA_TYPE' ] ; $ select -> where ( "$dependentColumn = ?" , $ value , $ type ) ; } return $ dependentTable -> fetchAll ( $ select ) ; }
docstring: Query a dependent table to retrieve rows matching the current row.
  
  @param string|Zend_Db_Table_Abstract  $dependentTable
  @param string                         OPTIONAL $ruleKey
  @param Zend_Db_Table_Select           OPTIONAL $select
  @return Zend_Db_Table_Rowset_Abstract Query result from $dependentTable
  @throws Zend_Db_Table_Row_Exception If $dependentTable is not a table or is not loadable.
docstring_tokens: Query a dependent table to retrieve rows matching the current row .