Ejemplo n.º 1
0
 /**
  * @param QQClause[]|QQClause|null $objClauses QQClause object or array of QQClause objects
  * @return QQSelect QQSelect clause containing all the nodes from all the QQSelect clauses from $objClauses,
  * or null if $objClauses contains no QQSelect clauses
  */
 public static function extractSelectClause($objClauses)
 {
     if ($objClauses instanceof QQSelect) {
         return $objClauses;
     }
     if (is_array($objClauses)) {
         $hasSelects = false;
         $objSelect = QQuery::Select();
         foreach ($objClauses as $objClause) {
             if ($objClause instanceof QQSelect) {
                 $hasSelects = true;
                 $objSelect->Merge($objClause);
             }
         }
         if (!$hasSelects) {
             return null;
         }
         return $objSelect;
     }
     return null;
 }