Replaced ->parents by getParents() and removed $this->nodes