Author: Elliot Levin (elliotlevin@hotmail.com)
Inheritance: extends Segment
Example #1
0
 public function visitOperation(Segments\Operation $query)
 {
     $textMap = [Segments\Operation::APPEND => 'Append with: ', Segments\Operation::DIFFERENCE => 'The difference from: ', Segments\Operation::EXCEPT => 'Where not contained in: ', Segments\Operation::INTERSECT => 'The intersection with: ', Segments\Operation::UNION => 'The union with: ', Segments\Operation::WHERE_IN => 'Where contained in: '];
     $this->compilation->append($textMap[$query->getOperationType()]);
     $this->compilation->appendSource($query->getSource(), true);
     $this->compilation->appendLine();
 }
Example #2
0
 public function visitOperation(Segments\Operation $query)
 {
     $otherValues = self::evaluateSource($query->getSource(), $this->resolvedParameters);
     switch ($query->getOperationType()) {
         case Segments\Operation::UNION:
             $this->traversable = $this->traversable->union($otherValues);
             break;
         case Segments\Operation::INTERSECT:
             $this->traversable = $this->traversable->intersect($otherValues);
             break;
         case Segments\Operation::DIFFERENCE:
             $this->traversable = $this->traversable->difference($otherValues);
             break;
         case Segments\Operation::APPEND:
             $this->traversable = $this->traversable->append($otherValues);
             break;
         case Segments\Operation::WHERE_IN:
             $this->traversable = $this->traversable->whereIn($otherValues);
             break;
         case Segments\Operation::EXCEPT:
             $this->traversable = $this->traversable->except($otherValues);
             break;
     }
 }
Example #3
0
 public function visitOperation(Segments\Operation $segment)
 {
     return $segment->updateSource($this->processSource($segment->getSource()));
 }