Example #1
0
 /**
  * Constructs a ParseQuery object that is the OR of the passed in queries objects.
  * All queries must have same class name.
  *
  * @param array $queryObjects Array of ParseQuery objects to OR.
  *
  * @throws \Exception If all queries don't have same class.
  *
  * @return ParseQuery The query that is the OR of the passed in queries.
  */
 public static function orQueries($queryObjects)
 {
     $className = null;
     $length = count($queryObjects);
     for ($i = 0; $i < $length; $i++) {
         if (is_null($className)) {
             $className = $queryObjects[$i]->className;
         }
         if ($className != $queryObjects[$i]->className) {
             throw new Exception('All queries must be for the same class');
         }
     }
     $query = new self($className);
     $query->_or($queryObjects);
     return $query;
 }