Example #1
0
 /**
  * Transforms a Query Source into SQL and parameter arrays
  *
  * @param SourceInterface $source The source
  * @param array &$sql
  * @return void
  */
 protected function parseSource(SourceInterface $source, array &$sql)
 {
     if ($source instanceof SelectorInterface) {
         $tableName = $source->getNodeTypeName();
         $sql['fields'][$tableName] = $tableName . '.*';
         $sql['tables'][$tableName] = $tableName;
         if ($this->query->getDistinct()) {
             $sql['fields'][$tableName] = $tableName . '.' . $this->query->getDistinct();
             $sql['keywords']['distinct'] = 'DISTINCT';
         }
     } elseif ($source instanceof JoinInterface) {
         $this->parseJoin($source, $sql);
     }
 }