Beispiel #1
0
 /**
  * @ActivityListQueryDesigner $queryDesigner
  *
  * @return DatagridInterface
  */
 public function createGrid(ActivityListQueryDesigner $source)
 {
     $this->datagridConfigurationBuilder->setGridName('related-activity');
     $this->datagridConfigurationBuilder->setSource($source);
     $config = $this->datagridConfigurationBuilder->getConfiguration();
     $stopPropagationListener = function (Event $e) {
         $e->stopPropagation();
     };
     $this->eventDispatcher->addListener(BuildBefore::NAME, $stopPropagationListener, 255);
     $grid = $this->gridBuilderLink->getService()->build($config, new ParameterBag());
     $this->eventDispatcher->removeListener(BuildBefore::NAME, $stopPropagationListener);
     return $grid;
 }
 /**
  * @param QueryDesignerModel                            $model
  * @param \PHPUnit_Framework_MockObject_MockObject|null $doctrine
  * @param \PHPUnit_Framework_MockObject_MockObject|null $functionProvider
  * @param \PHPUnit_Framework_MockObject_MockObject|null $virtualFieldProvider
  * @param array                                         $guessers
  *
  * @return DatagridConfigurationBuilder
  */
 protected function createDatagridConfigurationBuilder(QueryDesignerModel $model, $doctrine = null, $functionProvider = null, $virtualFieldProvider = null, array $guessers = [])
 {
     $builder = new DatagridConfigurationBuilder($functionProvider ?: $this->getFunctionProvider(), $virtualFieldProvider ?: $this->getVirtualFieldProvider(), $doctrine ?: $this->getDoctrine(), new DatagridGuesserMock($guessers));
     $builder->setGridName('test_grid');
     $builder->setSource($model);
     return $builder;
 }