private function fetch() { if ($this->it->valid()) { $v = $this->it->current(); $k = $this->it->key(); $this->v = $this->valueSelector->select($v, $k); $this->k = $this->keySelector->select($v, $k); } }
protected function fetchOuter() { if ($this->outer->valid()) { $this->outerV = $this->outer->current(); $this->outerK = $this->outer->key(); $this->inner = IteratorUtil::iterator($this->manySelector->select($this->outerV, $this->outerK)); } else { $this->inner = null; } }
protected function fetchIfValid() { if ($this->outer->valid()) { $outerV = $this->outer->current(); $outerK = $this->outer->key(); $compareKey = $this->outerCompareKeySelector->select($outerV, $outerK); $inners = $this->lookup->get($compareKey); $inners = new GroupingGinq(IteratorUtil::iterator($inners), $compareKey); $this->v = $this->resultValueSelector->select($outerV, $inners, $outerK, $compareKey); $this->k = $this->outer->key(); } }
/** * @param mixed $v0 - left value * @param mixed $v1 - right value * @param mixed|null $k0 - left key * @param mixed|null $k1 - right key * @return int */ public function compare($v0, $v1, $k0 = null, $k1 = null) { return $this->comparer->compare($this->compareKeySelector->select($v0, $k0), $this->compareKeySelector->select($v1, $k1), $k0, $k1); }