Ejemplo n.º 1
0
 /**
  * Строит FROM часть запроса (SELECT FROM ...)
  * @internal
  * @param ISelectBuilder $query
  * @return string
  */
 private function buildSelectFromPart(ISelectBuilder $query)
 {
     $tables = $query->getTables();
     if (!count($tables)) {
         return '';
     }
     $result = [];
     foreach ($tables as $table) {
         if (is_array($table)) {
             list($name, $alias) = $table;
             $name = $this->quoteIdentifier($name);
             $result[] = $name . ($alias ? ' AS ' . $this->quoteIdentifier($alias) : '');
         }
     }
     return "\nFROM " . implode(", ", $result);
 }