當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ServiceRegistryInterface::has方法代碼示例

本文整理匯總了PHP中Sylius\Component\Registry\ServiceRegistryInterface::has方法的典型用法代碼示例。如果您正苦於以下問題:PHP ServiceRegistryInterface::has方法的具體用法?PHP ServiceRegistryInterface::has怎麽用?PHP ServiceRegistryInterface::has使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Sylius\Component\Registry\ServiceRegistryInterface的用法示例。


在下文中一共展示了ServiceRegistryInterface::has方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get

 /**
  * {@inheritdoc}
  */
 public function get($type)
 {
     if (!$this->decoratedRegistry->has($type)) {
         return $this->defaultResolver;
     }
     return $this->decoratedRegistry->get($type);
 }
開發者ID:ReissClothing,項目名稱:Sylius,代碼行數:10,代碼來源:ResolverServiceRegistry.php

示例2: getDataSource

 /**
  * {@inheritdoc}
  */
 public function getDataSource(Grid $grid, Parameters $parameters)
 {
     $driver = $grid->getDriver();
     if (!$this->driversRegistry->has($driver)) {
         throw new UnsupportedDriverException($driver);
     }
     return $this->driversRegistry->get($driver)->getDataSource($grid->getDriverConfiguration(), $parameters);
 }
開發者ID:ahmadrabie,項目名稱:Sylius,代碼行數:11,代碼來源:DataSourceProvider.php

示例3: load

 /**
  * {@inheritdoc}
  */
 public function load(ThemeInterface $theme, $namespace = null)
 {
     $schemaAlias = sprintf('theme_%s', $theme->getName());
     if (!$this->schemaRegistry->has($schemaAlias)) {
         $schema = $this->themeSettingsSchemaProvider->getSchema($theme);
         $this->schemaRegistry->register($schemaAlias, $schema);
     }
     return $this->decoratedSettingsManager->load($schemaAlias, $namespace);
 }
開發者ID:ReissClothing,項目名稱:Sylius,代碼行數:12,代碼來源:ThemeSettingsManager.php

示例4: getDataSource

 /**
  * {@inheritdoc}
  */
 public function getDataSource(Grid $grid, Parameters $parameters)
 {
     $driverName = $grid->getDriver();
     if (!$this->driversRegistry->has($driverName)) {
         throw new UnsupportedDriverException($driverName);
     }
     /** @var DriverInterface $driver */
     $driver = $this->driversRegistry->get($driverName);
     return $driver->getDataSource($grid->getDriverConfiguration(), $parameters);
 }
開發者ID:ReissClothing,項目名稱:Sylius,代碼行數:13,代碼來源:DataSourceProvider.php

示例5: Parameters

 function it_throws_an_exception_if_driver_is_not_supported(Grid $grid, ServiceRegistryInterface $driversRegistry)
 {
     $parameters = new Parameters();
     $grid->getDriver()->willReturn('doctrine/banana');
     $driversRegistry->has('doctrine/banana')->willReturn(false);
     $this->shouldThrow(new UnsupportedDriverException('doctrine/banana'))->during('getDataSource', [$grid, $parameters]);
 }
開發者ID:loic425,項目名稱:Sylius,代碼行數:7,代碼來源:DataSourceProviderSpec.php

示例6:

 function it_registers_theme_schema_alias_if_not_exists_during_loading_settings(SettingsManagerInterface $decoratedSettingsManager, ServiceRegistryInterface $schemaRegistry, ThemeSettingsSchemaProviderInterface $themeSettingsSchemaProvider, ThemeInterface $theme, SettingsInterface $settings, SchemaInterface $schema)
 {
     $theme->getName()->willReturn('theme/name');
     $schemaRegistry->has('theme_theme/name')->willReturn(false);
     $themeSettingsSchemaProvider->getSchema($theme)->willReturn($schema);
     $schemaRegistry->register('theme_theme/name', $schema)->shouldBeCalled();
     $decoratedSettingsManager->load('theme_theme/name', null)->willReturn($settings);
     $this->load($theme)->shouldReturn($settings);
 }
開發者ID:ReissClothing,項目名稱:Sylius,代碼行數:9,代碼來源:ThemeSettingsManagerSpec.php


注:本文中的Sylius\Component\Registry\ServiceRegistryInterface::has方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。