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


PHP RepositoryInterface::findAll方法代码示例

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


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

示例1: getZones

 /**
  * @param array $options
  *
  * @return array
  */
 private function getZones(array $options)
 {
     if (isset($options['scope'])) {
         return $this->zoneRepository->findBy(['scope' => $options['scope']]);
     }
     return $this->zoneRepository->findAll();
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:12,代码来源:ZoneBasedConfigurationType.php

示例2: getDefinedLocalesCodes

 /**
  * {@inheritdoc}
  */
 public function getDefinedLocalesCodes()
 {
     $locales = $this->localeRepository->findAll();
     return array_map(function (LocaleInterface $locale) {
         return $locale->getCode();
     }, $locales);
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:10,代码来源:LocaleProvider.php

示例3: getLocales

 /**
  * @return array
  */
 private function getLocales()
 {
     /** @var LocaleInterface[] $locales */
     $locales = $this->localeRepository->findAll();
     foreach ($locales as $locale) {
         (yield $locale->getCode());
     }
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:11,代码来源:PaymentMethodExampleFactory.php

示例4: getLocalesCodes

 /**
  * @return array
  */
 private function getLocalesCodes()
 {
     $localesCodes = [];
     /** @var LocaleInterface $locale */
     foreach ($this->localeRepository->findAll() as $locale) {
         $localesCodes[$locale->getName()] = $locale->getCode();
     }
     return $localesCodes;
 }
开发者ID:starspire,项目名称:Sylius,代码行数:12,代码来源:LocaleCodeChoiceType.php

示例5: configureOptions

 /**
  * {@inheritdoc}
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     $resolver->setDefaults(['choices' => function (Options $options) {
         if (null === $options['enabled']) {
             return $this->countryRepository->findAll();
         }
         return $this->countryRepository->findBy(['enabled' => $options['enabled']]);
     }, 'choice_value' => 'code', 'choice_label' => 'name', 'choice_translation_domain' => false, 'enabled' => true, 'label' => 'sylius.form.address.country', 'placeholder' => 'sylius.form.country.select']);
 }
开发者ID:sylius,项目名称:sylius,代码行数:12,代码来源:CountryChoiceType.php

示例6: configureOptions

 /**
  * {@inheritdoc}
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     $resolver->setDefaults(['choices' => function (Options $options) {
         if (isset($options['subject'])) {
             return $this->paymentMethodsResolver->getSupportedMethods($options['subject']);
         }
         return $this->paymentMethodRepository->findAll();
     }, 'choice_value' => 'id', 'choice_label' => 'name', 'choice_translation_domain' => false])->setDefined(['subject'])->setAllowedTypes('subject', PaymentInterface::class);
 }
开发者ID:NeverResponse,项目名称:Sylius,代码行数:12,代码来源:PaymentMethodChoiceType.php

示例7: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $productAssociationTypes = $this->productAssociationTypeRepository->findAll();
     /** @var ProductAssociationTypeInterface $productAssociationType */
     foreach ($productAssociationTypes as $productAssociationType) {
         $builder->add($productAssociationType->getCode(), TextType::class, ['label' => $productAssociationType->getName()]);
     }
     $builder->addModelTransformer($this->productsToProductAssociationsTransformer);
 }
开发者ID:sylius,项目名称:sylius,代码行数:12,代码来源:ProductAssociationsType.php

示例8: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $taxonomies = $this->taxonomyRepository->findAll();
     $builder->addModelTransformer(new $options['model_transformer']['class']($taxonomies, $options['model_transformer']['save_objects']));
     foreach ($taxonomies as $taxonomy) {
         /* @var $taxonomy TaxonomyInterface */
         $builder->add($taxonomy->getId(), 'choice', array('choice_list' => new ObjectChoiceList($this->taxonRepository->getTaxonsAsList($taxonomy), null, array(), null, 'id'), 'multiple' => $options['multiple'], 'label' => $taxonomy->getName()));
     }
 }
开发者ID:lingoda,项目名称:Sylius,代码行数:12,代码来源:TaxonSelectionType.php

示例9: configureOptions

 /**
  * {@inheritdoc}
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     $choiceList = function (Options $options) {
         if (null === $options['country']) {
             return new ObjectChoiceList($this->repository->findAll(), null, array(), null, 'id');
         }
         return new ObjectChoiceList($options['country']->getProvinces(), null, array(), null, 'id');
     };
     $resolver->setDefaults(array('choice_list' => $choiceList, 'country' => null, 'label' => 'sylius.form.address.province', 'empty_value' => 'sylius.form.province.select'));
 }
开发者ID:lingoda,项目名称:Sylius,代码行数:13,代码来源:ProvinceChoiceType.php

示例10: findCaptureToken

 /**
  * @return TokenInterface
  *
  * @throws \RuntimeException
  */
 private function findCaptureToken()
 {
     $tokens = $this->securityTokenRepository->findAll();
     foreach ($tokens as $token) {
         if (strpos($token->getTargetUrl(), 'capture')) {
             return $token;
         }
     }
     throw new \RuntimeException('Cannot find capture token, check if you are after proper checkout steps');
 }
开发者ID:ahmadrabie,项目名称:Sylius,代码行数:15,代码来源:PaypalExpressCheckoutPage.php

示例11: configureOptions

 /**
  * {@inheritdoc}
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(['choices' => function (Options $options) {
         if (null === $options['enabled']) {
             return $this->localeRepository->findAll();
         }
         return $this->localeRepository->findBy(['enabled' => $options['enabled']]);
     }, 'choice_value' => 'code', 'choice_label' => 'name', 'choice_translation_domain' => false, 'enabled' => null, 'label' => 'sylius.form.locale.locale', 'placeholder' => 'sylius.form.locale.select']);
 }
开发者ID:sylius,项目名称:sylius,代码行数:13,代码来源:LocaleChoiceType.php

示例12: configureOptions

 /**
  * {@inheritdoc}
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     $choices = function (Options $options) {
         if (null === $options['customer']) {
             return $this->addressRepository->findAll();
         }
         return $this->addressRepository->findBy(['customer' => $options['customer']]);
     };
     $resolver->setDefaults(['class' => AddressInterface::class, 'choices' => $choices, 'customer' => null, 'label' => false, 'placeholder' => false]);
 }
开发者ID:loic425,项目名称:Sylius,代码行数:13,代码来源:AddressChoiceType.php

示例13: getAvailableCountries

 /**
  * Should be private, used public to support PHP 5.3
  *
  * @internal
  *
  * @return array
  */
 public function getAvailableCountries()
 {
     $availableCountries = Intl::getRegionBundle()->getCountryNames();
     /** @var CountryInterface[] $definedCountries */
     $definedCountries = $this->countryRepository->findAll();
     foreach ($definedCountries as $country) {
         unset($availableCountries[$country->getIsoName()]);
     }
     return $availableCountries;
 }
开发者ID:aleherse,项目名称:Sylius,代码行数:17,代码来源:CountryType.php

示例14: getAvailableLocales

 /**
  * Should be private, used public to support PHP 5.3
  *
  * @internal
  *
  * @return array
  */
 public function getAvailableLocales()
 {
     $availableLocales = Intl::getLocaleBundle()->getLocaleNames();
     /** @var LocaleInterface[] $definedLocales */
     $definedLocales = $this->localeRepository->findAll();
     foreach ($definedLocales as $locale) {
         unset($availableLocales[$locale->getCode()]);
     }
     return $availableLocales;
 }
开发者ID:lingoda,项目名称:Sylius,代码行数:17,代码来源:LocaleType.php

示例15: getZoneCodes

 /**
  * @return array
  */
 private function getZoneCodes()
 {
     $zoneObjects = $this->zoneRepository->findAll();
     $zones = [];
     /* @var ZoneInterface $zone */
     foreach ($zoneObjects as $zone) {
         $zones[$zone->getCode()] = $zone->getName();
     }
     return $zones;
 }
开发者ID:ahmadrabie,项目名称:Sylius,代码行数:13,代码来源:ZoneCodeChoiceType.php


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