當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。