当前位置: 首页>>代码示例>>PHP>>正文


PHP DatagridConfiguration::createNamed方法代码示例

本文整理汇总了PHP中Oro\Bundle\DataGridBundle\Datagrid\Common\DatagridConfiguration::createNamed方法的典型用法代码示例。如果您正苦于以下问题:PHP DatagridConfiguration::createNamed方法的具体用法?PHP DatagridConfiguration::createNamed怎么用?PHP DatagridConfiguration::createNamed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Oro\Bundle\DataGridBundle\Datagrid\Common\DatagridConfiguration的用法示例。


在下文中一共展示了DatagridConfiguration::createNamed方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getConfiguration

 /**
  * {@inheritDoc}
  */
 public function getConfiguration($gridName)
 {
     if (!isset($this->rawConfiguration[$gridName])) {
         throw new RuntimeException(sprintf('A configuration for "%s" datagrid was not found.', $gridName));
     }
     if (!isset($this->processedConfiguration[$gridName])) {
         $config = $this->resolver->resolve($gridName, $this->rawConfiguration[$gridName]);
         $this->processedConfiguration[$gridName] = $config;
     }
     return DatagridConfiguration::createNamed($gridName, $this->processedConfiguration[$gridName]);
 }
开发者ID:Maksold,项目名称:platform,代码行数:14,代码来源:ConfigurationProvider.php

示例2: testBuildAfter

 public function testBuildAfter()
 {
     $config = DatagridConfiguration::createNamed(self::TEST_GRID_NAME, []);
     $acceptor = new Acceptor();
     $acceptor->setConfig($config);
     $parameters = $this->getMock('Oro\\Bundle\\DataGridBundle\\Datagrid\\ParameterBag');
     $grid = new Datagrid(self::TEST_GRID_NAME, $config, $parameters);
     $grid->setAcceptor($acceptor);
     $qb = $this->getMockBuilder('Doctrine\\ORM\\QueryBuilder')->disableOriginalConstructor()->getMock();
     $qb->expects($this->once())->method('getDQLPart')->with($this->equalTo('from'))->will($this->returnValue([new From(self::TEST_ENTITY_NAME, 'alias')]));
     $datasourceMock = $this->getMockBuilder('Oro\\Bundle\\DataGridBundle\\Datasource\\Orm\\OrmDatasource')->disableOriginalConstructor()->getMock();
     $datasourceMock->expects($this->any())->method('getQueryBuilder')->will($this->returnValue($qb));
     $this->generator->expects($this->once())->method('generate')->with(self::TEST_ENTITY_NAME)->will($this->returnValue([]));
     $grid->setDatasource($datasourceMock);
     $event = new BuildAfter($grid);
     $this->listener->buildAfter($event);
     $this->assertContains('oronavigation/js/content/grid-builder', $config->offsetGetByPath(sprintf('%s[%s]', ToolbarExtension::OPTIONS_PATH, MetadataObject::REQUIRED_MODULES_KEY)), 'Should add require js module');
 }
开发者ID:Maksold,项目名称:platform,代码行数:18,代码来源:DataGridTagListenerTest.php

示例3: convert

 /**
  * Converts a query specified in $source parameter to a datagrid configuration
  *
  * @param string                $gridName
  * @param AbstractQueryDesigner $source
  * @return DatagridConfiguration
  */
 public function convert($gridName, AbstractQueryDesigner $source)
 {
     $this->config = DatagridConfiguration::createNamed($gridName, []);
     $this->doConvert($source);
     return $this->config;
 }
开发者ID:xamin123,项目名称:platform,代码行数:13,代码来源:DatagridConfigurationQueryConverter.php

示例4: buildProvider

 /**
  * @return array
  */
 public function buildProvider()
 {
     $stubDatagridClass = 'Oro\\Bundle\\DataGridBundle\\Datagrid\\Datagrid';
     $baseEventList = [['oro_datagrid.datagrid.build.pre', 'Oro\\Bundle\\DataGridBundle\\Event\\PreBuild'], ['oro_datagrid.datagrid.build.before', 'Oro\\Bundle\\DataGridBundle\\Event\\BuildBefore'], ['oro_datagrid.datagrid.build.after', 'Oro\\Bundle\\DataGridBundle\\Event\\BuildAfter']];
     $extToAdd = $this->getMockForAbstractClass('Oro\\Bundle\\DataGridBundle\\Extension\\ExtensionVisitorInterface');
     $extToAdd2 = $this->getMockForAbstractClass('Oro\\Bundle\\DataGridBundle\\Extension\\ExtensionVisitorInterface');
     $extNotToAdd = $this->getMockForAbstractClass('Oro\\Bundle\\DataGridBundle\\Extension\\ExtensionVisitorInterface');
     $extToAdd->expects($this->any())->method('isApplicable')->will($this->returnValue(true));
     $extToAdd2->expects($this->any())->method('isApplicable')->will($this->returnValue(true));
     $extNotToAdd->expects($this->any())->method('isApplicable')->will($this->returnValue(false));
     return ['Base datagrid should be created without extensions' => [DatagridConfiguration::createNamed(self::TEST_DATAGRID_NAME, []), self::DEFAULT_DATAGRID_CLASS, $baseEventList, 0], 'Datagrid should be created as object type passed in config' => [DatagridConfiguration::createNamed(self::TEST_DATAGRID_NAME, ['options' => ['base_datagrid_class' => $stubDatagridClass]]), $stubDatagridClass, $baseEventList, 0], 'Extension passed check' => [DatagridConfiguration::createNamed(self::TEST_DATAGRID_NAME, []), self::DEFAULT_DATAGRID_CLASS, $baseEventList, 1, [$extToAdd, $extNotToAdd]], 'Both extensions passed check' => [DatagridConfiguration::createNamed(self::TEST_DATAGRID_NAME, []), self::DEFAULT_DATAGRID_CLASS, $baseEventList, 2, [$extToAdd, $extNotToAdd, $extToAdd2]]];
 }
开发者ID:xamin123,项目名称:platform,代码行数:15,代码来源:BuilderTest.php

示例5: getDataGrid

 /**
  * @return \PHPUnit_Framework_MockObject_MockObject|DatagridInterface
  */
 protected function getDataGrid()
 {
     $dataGrid = $this->getMockBuilder('Oro\\Bundle\\DataGridBundle\\Datagrid\\DatagridInterface')->getMockForAbstractClass();
     $columnAliases = ['testField' => 'c1'];
     $config = DatagridConfiguration::createNamed('test', []);
     $config->offsetSetByPath(MarketingListProvider::DATAGRID_COLUMN_ALIASES_PATH, $columnAliases);
     $dataGrid->expects($this->any())->method('getConfig')->will($this->returnValue($config));
     return $dataGrid;
 }
开发者ID:heoffice,项目名称:crm,代码行数:12,代码来源:MarketingListProviderTest.php


注:本文中的Oro\Bundle\DataGridBundle\Datagrid\Common\DatagridConfiguration::createNamed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。