예제 #1
0
 /**
  * {@inheritdoc}
  */
 protected function projectDataProvider()
 {
     /** @var \Cubiche\Core\Projection\ObjectProjector $projector */
     $projector = $this->newTestedInstance();
     $result = new DefaultProjectionBuilder();
     $result->set('foo', 1);
     $result->set('bar', 2);
     return array(array($projector, (object) array('foo' => 1, 'bar' => 2), new \ArrayIterator(array($result))));
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 protected function projectDataProvider()
 {
     $forEachProjector = new ForEachProjector(Selectors::key('list'), new ObjectProjector());
     /** @var \Cubiche\Core\Projection\WhereProjector $projector */
     $projector = $this->newTestedInstance(Criteria::property('foo')->eq(1), $forEachProjector);
     $result = new DefaultProjectionBuilder();
     $result->set('foo', 1);
     return array(array($projector, array('list' => array((object) array('foo' => 1), (object) array('foo' => 2), (object) array('foo' => 3))), new \ArrayIterator(array($result))));
 }
 /**
  * {@inheritdoc}
  */
 protected function projectDataProvider()
 {
     /** @var \Cubiche\Core\Projection\PropertyProjectorBuilder $projector */
     $projector = $this->newTestedInstance(Selectors::key('foo'));
     $projector->select(Selectors::key('bar'))->as('baz');
     $result = new DefaultProjectionBuilder();
     $result->set('foo', 1);
     $result->set('baz', 2);
     return array(array($projector, array('foo' => 1, 'bar' => 2), new \ArrayIterator(array($result))));
 }
예제 #4
0
 /**
  * {@inheritdoc}
  */
 protected function projectDataProvider()
 {
     $propertyProyector = new PropertyProjector();
     $propertyProyector->add(new Property(Selectors::key('bar'), 'fooBar'));
     /** @var \Cubiche\Core\Projection\ForEachProjector $projector */
     $projector = $this->newTestedInstance(Selectors::key('foo'), $propertyProyector);
     $result1 = new DefaultProjectionBuilder();
     $result1->set('fooBar', 1);
     $result2 = new DefaultProjectionBuilder();
     $result2->set('fooBar', 2);
     return array(array($projector, array('foo' => array(array('bar' => 1), array('bar' => 2))), new \ArrayIterator(array($result1, $result2))));
 }
예제 #5
0
 /**
  * {@inheritdoc}
  */
 protected function projectDataProvider()
 {
     $propertyProyector1 = new PropertyProjector();
     $propertyProyector1->add(new Property(Selectors::key('foo'), 'foo'));
     $propertyProyector2 = new PropertyProjector();
     $propertyProyector2->add(new Property(Selectors::key('bar'), 'bar'));
     /** @var \Cubiche\Core\Projection\JoinProjector $projector */
     $projector = $this->newTestedInstance($propertyProyector1, $propertyProyector2);
     $result = new DefaultProjectionBuilder();
     $result->set('foo', 1);
     $result->set('bar', 2);
     return array(array($projector, array('foo' => 1, 'bar' => 2), new \ArrayIterator(array($result))));
 }
예제 #6
0
 /**
  * @return array
  */
 protected function joinTest()
 {
     $projector = Projectors::select(Selectors::key('foo'))->join(Projectors::forAll(Selectors::key('list'), Projectors::selectAll()))->on('foo')->eq('bar');
     return array($projector, array('foo' => 1, 'list' => array(array('bar' => 1), array('bar' => 2), array('bar' => 3))), new \ArrayIterator(array(DefaultProjectionBuilder::fromObject((object) array('foo' => 1, 'bar' => 1)))));
 }