Example #1
0
 function __construct($iterator, $list, $comparefunc = NULL)
 {
     if (!$list instanceof LinqIterator) {
         $this->secondlist = LINQ::From($list);
     } else {
         $this->secondlist = $list;
     }
     parent::__construct($iterator, $comparefunc);
 }
 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;
 }
 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);
 }
Example #4
0
 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;
     $this->aiterator = $iterator;
     //we will add our real iterator when we are ready (first access)
     //parent::__construct(new EmptyIterator());
 }
 public function testSelfReference()
 {
     $a = LINQ::Linq(array(1, 2, 3, 4, 5));
     $i = $a->Zip($a, function ($i, $j) {
         return $i . ":" . $j;
     });
     $this->AssertIteratorsEqual($i, array("1:1", "2:2", "3:3", "4:4", "5:5"));
 }
Example #6
0
 public function Concat($list)
 {
     $currentiterfunc = $this->getIteratorFunction;
     $newiterfunc = function () use($currentiterfunc, $list) {
         $concatarr = array($currentiterfunc(), $list);
         $newlist = LINQ::Linq($concatarr);
         return $newlist->SelectMany(function ($i) {
             return $i;
         });
     };
     return new LinqIterator($newiterfunc);
 }