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