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


PHP ExecutionContextInterface::getPropertyPath方法代码示例

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


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

示例1: __construct

 /**
  * @param mixed                               $subject
  * @param ConstraintValidatorFactoryInterface $constraintValidatorFactory
  * @param ExecutionContextInterface           $context
  * @param string                              $group
  */
 public function __construct($subject, ConstraintValidatorFactoryInterface $constraintValidatorFactory, ExecutionContextInterface $context, $group)
 {
     $this->subject = $subject;
     $this->context = $context;
     $this->group = $group;
     $this->constraintValidatorFactory = $constraintValidatorFactory;
     $this->current = '';
     $this->basePropertyPath = $this->context->getPropertyPath();
 }
开发者ID:ruslan-polutsygan,项目名称:SonataCoreBundle,代码行数:15,代码来源:ErrorElement.php

示例2: __construct

 /**
  * @param mixed                                                     $subject
  * @param ConstraintValidatorFactoryInterface                       $constraintValidatorFactory
  * @param LegacyExecutionContextInterface|ExecutionContextInterface $context
  * @param string                                                    $group
  */
 public function __construct($subject, ConstraintValidatorFactoryInterface $constraintValidatorFactory, $context, $group)
 {
     if (!$context instanceof LegacyExecutionContextInterface && !$context instanceof ExecutionContextInterface) {
         throw new \InvalidArgumentException(sprintf('Argument 3 passed to %s::__construct() must be an instance of Symfony\\Component\\Validator\\ExecutionContextInterface or Symfony\\Component\\Validator\\Context\\ExecutionContextInterface.', get_class($this)));
     }
     $this->subject = $subject;
     $this->context = $context;
     $this->group = $group;
     $this->constraintValidatorFactory = $constraintValidatorFactory;
     $this->current = '';
     $this->basePropertyPath = $this->context->getPropertyPath();
 }
开发者ID:LamaDelRay,项目名称:test_symf,代码行数:18,代码来源:ErrorElement.php

示例3: isVoteValid

 /**
  * {@inheritdoc}
  */
 public function isVoteValid(ExecutionContextInterface $context)
 {
     if (!$this->checkValue($this->value)) {
         $message = 'A vote cannot have a 0 value';
         $propertyPath = $context->getPropertyPath() . '.value';
         $context->addViolationAt($propertyPath, $message);
     }
 }
开发者ID:saberyounis,项目名称:Sonata-Project,代码行数:11,代码来源:Vote.php

示例4: let

 function let(ProductManager $productManager, ExecutionContextInterface $context, Form $form, ProductInterface $product, ProductValueInterface $value)
 {
     $this->beConstructedWith($productManager);
     $product->getValue('sku')->willReturn($value);
     $form->getData()->willReturn($product);
     $context->getPropertyPath()->willReturn(self::PROPERTY_PATH);
     $context->getRoot()->willReturn($form);
     $this->initialize($context);
 }
开发者ID:vpetrovych,项目名称:pim-community-dev,代码行数:9,代码来源:UniqueValueValidatorSpec.php

示例5: let

 function let(ProductRepositoryInterface $productRepository, UniqueValuesSet $uniqueValuesSet, ExecutionContextInterface $context, Form $form, ProductInterface $product, ProductValueInterface $value)
 {
     $this->beConstructedWith($productRepository, $uniqueValuesSet);
     $product->getValue('unique_attribute')->willReturn($value);
     $form->getData()->willReturn($product);
     $context->getPropertyPath()->willReturn(self::PROPERTY_PATH);
     $context->getRoot()->willReturn($form);
     $this->initialize($context);
 }
开发者ID:jacko972,项目名称:pim-community-dev,代码行数:9,代码来源:UniqueValueValidatorSpec.php

示例6: isVoteValid

 /**
  * {@inheritdoc}
  */
 public function isVoteValid(ExecutionContextInterface $context)
 {
     if (!$this->checkValue($this->value)) {
         $message = 'A vote cannot have a 0 value';
         $propertyPath = $context->getPropertyPath() . '.value';
         if ($context instanceof \Symfony\Component\Validator\Context\ExecutionContextInterface) {
             // Validator 2.5 API
             $context->buildViolation($message)->atPath($propertyPath)->addViolation();
         } else {
             $context->addViolationAt($propertyPath, $message);
         }
     }
 }
开发者ID:NonoXyde,项目名称:FOSCommentBundle,代码行数:16,代码来源:Vote.php

示例7: getRowData

 private function getRowData(ExecutionContextInterface $context)
 {
     $propertyPath = $context->getPropertyPath();
     $data = $this->getRowData($context);
 }
开发者ID:zorn-v,项目名称:thelia,代码行数:5,代码来源:CountryStateMigrationType.php


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