public function queryUsersWithQueryExpectResultsKey()
 {
     $AVUser = $this->AVUser;
     $userQuery = new AVQuery('users');
     $userQuery->whereExists('phone');
     $return = $userQuery->find();
     \Enhance\Assert::isTrue(property_exists($return, 'results'));
 }
Example #2
0
 /**
  * Constructs a AVQuery object that is the OR of the passed in queries objects.
  * All queries must have same class name.
  *
  * @param array $queryObjects Array of AVQuery objects to OR.
  *
  * @return AVQuery The query that is the OR of the passed in queries.
  *
  * @throws \Exception If all queries don't have same class.
  */
 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 AVQuery($className);
     $query->_or($queryObjects);
     return $query;
 }