public function testEqualTo() { $query = new Query("TestObject"); $query->equalTo("age", 24); $out = $query->encode(); $this->assertEquals(json_encode(array("age" => 24)), $out["where"]); $query->equalTo("age", 37); $out = $query->encode(); $this->assertEquals(json_encode(array("age" => 37)), $out["where"]); }
/** * Query on the parent class where child is in the relation * * @param Object $child Child object * @return Query */ public function getReverseQuery(Object $child) { $query = new Query($this->parent->getClassName()); $query->equalTo($this->key, $child->getPointer()); return $query; }
/** * Get roles the user belongs to * * @return array Array of Role */ public function getRoles() { if (!$this->getObjectId()) { return array(); } $query = new Query("_Role"); $query->equalTo("users", $this); $roles = $query->find(); return $roles; }