function __construct($iterator, $intersectwith, $comparefunc = NULL)
 {
     parent::__construct($iterator);
     if (!$intersectwith instanceof LinqIterator) {
         $this->secondlist = LINQ::From($intersectwith);
     } else {
         $this->secondlist = $intersectwith;
     }
     $this->ismatch = $comparefunc;
 }
Example #2
0
 protected function firstrun()
 {
     $lookup = $this->jointo->ToLookup($this->keyselectjoin, NULL, $this->ismatch);
     $outerkeyselector = $this->keyselectouter;
     $resultselector = $this->resultselect;
     $iter = new \RecursiveIteratorIterator(new SelectManyIterator($this->aiterator, function ($o) use($lookup, $outerkeyselector) {
         return $lookup[call_user_func_array($outerkeyselector, array($o))];
     }, $resultselector));
     //append our iterator to the previous empty one
     //$this->iterator = $iter;
     parent::__construct($iter);
 }
 function __construct($iterator, $jointo, $keyselectouter, $keyselectjoin, $resultselect, $comparefunc = NULL)
 {
     if ($jointo instanceof LinqIterator) {
         $this->jointo = $jointo;
     } else {
         $this->jointo = LINQ::From($jointo);
     }
     $this->keyselectouter = $keyselectouter;
     $this->keyselectjoin = $keyselectjoin;
     $this->resultselect = $resultselect;
     $this->ismatch = $comparefunc;
     parent::__construct($iterator);
 }