original_string: private function buildRightJoins()
      {
          $resultArray = array();
  
          foreach ( $this->rightJoins as $rJoinPart )
          {
              $oneItemResult = '';
              if ( $rJoinPart === null ) 
              {
                  break; // this is last empty entry so cancel adding.
              }
  
              // reverse lists of tables and conditions to make LEFT JOIN 
              // that will produce result equal to original right join.
              $reversedTables = array_reverse( $rJoinPart['tables'] );
              $reversedConditions = array_reverse( $rJoinPart['conditions'] );
  
              // adding first table.
              list( $key, $val ) = each( $reversedTables ); 
              $oneItemResult .= $val;
  
              while ( list( $key, $nextCondition ) = each( $reversedConditions ) )
              {
                  list( $key2, $nextTable ) = each( $reversedTables );   
                 $oneItemResult .= " LEFT JOIN {$nextTable} ON {$nextCondition}";
              }
              $resultArray[] = $oneItemResult;
          }
  
          return join( ', ', $resultArray );
      }
code: private function buildRightJoins()
      {
          $resultArray = array();
  
          foreach ( $this->rightJoins as $rJoinPart )
          {
              $oneItemResult = '';
              if ( $rJoinPart === null ) 
              {
                  break; // this is last empty entry so cancel adding.
              }
  
              // reverse lists of tables and conditions to make LEFT JOIN 
              // that will produce result equal to original right join.
              $reversedTables = array_reverse( $rJoinPart['tables'] );
              $reversedConditions = array_reverse( $rJoinPart['conditions'] );
  
              // adding first table.
              list( $key, $val ) = each( $reversedTables ); 
              $oneItemResult .= $val;
  
              while ( list( $key, $nextCondition ) = each( $reversedConditions ) )
              {
                  list( $key2, $nextTable ) = each( $reversedTables );   
                 $oneItemResult .= " LEFT JOIN {$nextTable} ON {$nextCondition}";
              }
              $resultArray[] = $oneItemResult;
          }
  
          return join( ', ', $resultArray );
      }
code_tokens: private function buildRightJoins ( ) { $ resultArray = array ( ) ; foreach ( $ this -> rightJoins as $ rJoinPart ) { $ oneItemResult = '' ; if ( $ rJoinPart === null ) { break ; // this is last empty entry so cancel adding. } // reverse lists of tables and conditions to make LEFT JOIN  // that will produce result equal to original right join. $ reversedTables = array_reverse ( $ rJoinPart [ 'tables' ] ) ; $ reversedConditions = array_reverse ( $ rJoinPart [ 'conditions' ] ) ; // adding first table. list ( $ key , $ val ) = each ( $ reversedTables ) ; $ oneItemResult .= $ val ; while ( list ( $ key , $ nextCondition ) = each ( $ reversedConditions ) ) { list ( $ key2 , $ nextTable ) = each ( $ reversedTables ) ; $ oneItemResult .= " LEFT JOIN {$nextTable} ON {$nextCondition}" ; } $ resultArray [ ] = $ oneItemResult ; } return join ( ', ' , $ resultArray ) ; }
docstring: Returns SQL string with part of FROM clause that performs right join emulation.
  
  SQLite don't support right joins directly but there is workaround.
  identical result could be acheived using right joins for tables in reverce order.
  
  String created from entries of $rightJoins.
  One entry is a complete table_reference clause of SQL FROM clause.
  
  <code>
  rightJoins[0][tables] = array( 'table1', 'table2', 'table3' )
  rightJoins[0][conditions] = array( condition1, condition2 )
  </code>
  forms SQL: 'table3 LEFT JOIN table2 condition2 ON LEFT JOIN table1 ON condition1'.
  
  
  @return string the SQL call including all right joins set in query.
docstring_tokens: Returns SQL string with part of FROM clause that performs right join emulation .