Example #1
0
 public function testAddExtraOptionCannotOverwitePreservedOption()
 {
     $query = new Query("TestObject");
     $query->skip(100);
     $query->addOption("skip", 50);
     $out = $query->encode();
     $this->assertEquals(100, $out["skip"]);
 }
Example #2
0
 /**
  * Query on the target class of relation
  *
  * @return Query
  */
 public function getQuery()
 {
     if ($this->targetClassName) {
         $query = new Query($this->targetClassName);
     } else {
         $query = new Query($this->parent->getClassName());
         $query->addOption("redirectClassNameForKey", $this->key);
     }
     $query->relatedTo($this->key, $this->parent);
     return $query;
 }