/** * @return null|Query */ public function getRootQuery() { return $this->parent ? $this->parent->getRootQuery() : $this; }