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


PHP RepositoryInterface::getClassName方法代码示例

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


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

示例1: reverseTransform

 /**
  * {@inheritdoc}
  */
 public function reverseTransform($value)
 {
     if (null === $value) {
         return null;
     }
     $class = $this->repository->getClassName();
     Assert::isInstanceOf($value, $class);
     $accessor = PropertyAccess::createPropertyAccessor();
     return $accessor->getValue($value, $this->identifier);
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:13,代码来源:IdentifierToResourceTransformer.php

示例2: reverseTransform

 /**
  * {@inheritdoc}
  */
 public function reverseTransform($value)
 {
     if (null === $value) {
         return null;
     }
     $resource = $this->repository->findOneBy([$this->identifier => $value]);
     if (null === $resource) {
         throw new TransformationFailedException(sprintf('Object "%s" with identifier "%s"="%s" does not exist.', $this->repository->getClassName(), $this->identifier, $value));
     }
     return $resource;
 }
开发者ID:NeverResponse,项目名称:Sylius,代码行数:14,代码来源:ResourceToIdentifierTransformer.php

示例3:

 function it_reverse_transform_resource_to_identifier(RepositoryInterface $repository, FakeEntity $value)
 {
     $repository->getClassName()->willReturn(FakeEntity::class);
     $value->getId()->willReturn(6);
     $this->reverseTransform($value)->shouldReturn(6);
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:6,代码来源:IdentifierToResourceTransformerSpec.php

示例4:

 function it_transforms_resource_in_identifier(RepositoryInterface $repository, ResourceInterface $resource)
 {
     $repository->getClassName()->willReturn(ResourceInterface::class);
     $resource->getId()->willReturn(6);
     $this->transform($resource)->shouldReturn(6);
 }
开发者ID:NeverResponse,项目名称:Sylius,代码行数:6,代码来源:ResourceToIdentifierTransformerSpec.php

示例5: let

 function let(RepositoryInterface $repository)
 {
     $repository->getClassName()->willReturn('spec\\Sylius\\Bundle\\ResourceBundle\\Form\\DataTransformer\\FakeEntity');
     $this->beConstructedWith($repository, 'id');
 }
开发者ID:gabiudrescu,项目名称:Sylius,代码行数:5,代码来源:ResourceToIdentifierTransformerSpec.php

示例6: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('groups', 'sylius_group_from_identifier', ['label' => 'sylius.form.action.customer_group', 'property' => 'name', 'class' => $this->groupRepository->getClassName(), 'constraints' => [new NotBlank(), new Type(['type' => 'numeric'])]]);
 }
开发者ID:gabiudrescu,项目名称:Sylius,代码行数:7,代码来源:CustomerGroupType.php

示例7: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('group', CustomerGroupCodeChoiceType::class, ['label' => 'sylius.form.promotion_action.customer_group', 'property' => 'name', 'class' => $this->groupRepository->getClassName(), 'constraints' => [new NotBlank(['groups' => ['sylius']]), new Type(['type' => 'numeric', 'groups' => ['sylius']])]]);
 }
开发者ID:Niiko,项目名称:Sylius,代码行数:7,代码来源:CustomerGroupType.php


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