소스 검색

Fix missing bit in the InlineConstraint migration

Thomas Rabaix 10 년 전
부모
커밋
fc2219a681
2개의 변경된 파일22개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 0
      Validator/Constraints/InlineConstraint.php
  2. 15 1
      Validator/InlineValidator.php

+ 7 - 0
Validator/Constraints/InlineConstraint.php

@@ -17,4 +17,11 @@ use Sonata\CoreBundle\Validator\Constraints\InlineConstraint as BaseInlineConstr
  */
 class InlineConstraint extends BaseInlineConstraint
 {
+    /**
+     * {@inheritDoc}
+     */
+    public function validatedBy()
+    {
+        return 'sonata.admin.validator.inline';
+    }
 }

+ 15 - 1
Validator/InlineValidator.php

@@ -11,11 +11,25 @@
 namespace Sonata\AdminBundle\Validator;
 
 use Sonata\CoreBundle\Validator\InlineValidator as BaseInlineValidator;
+use Sonata\AdminBundle\Validator\ErrorElement;
 
 /**
  * @deprecated
  */
 class InlineValidator extends BaseInlineValidator
 {
-
+    /**
+     * @param mixed $value
+     *
+     * @return ErrorElement
+     */
+    protected function getErrorElement($value)
+    {
+        return new ErrorElement(
+            $value,
+            $this->constraintValidatorFactory,
+            $this->context,
+            $this->context->getGroup()
+        );
+    }
 }