소스 검색

FD3-295 Se quitó la validación de position en ONU

Guillermo Espinoza 7 년 전
부모
커밋
cb5c1e8885
2개의 변경된 파일0개의 추가작업 그리고 29개의 파일을 삭제
  1. 0 2
      src/FTTHBundle/Entity/ONU.php
  2. 0 27
      src/FTTHBundle/Validator/ONUPositionValidator.php

+ 0 - 2
src/FTTHBundle/Entity/ONU.php

@@ -144,8 +144,6 @@ class ONU implements DeviceInterface, TenancyIdTraitInterface, LocationInterface
      * @var int
      *
      * @ORM\Column(type="integer", nullable=false, options={"default": "0"})
-     *
-     * @Assert\Callback({"FTTHBundle\Validator\ONUPositionValidator", "validate"})
      */
     private $position = 0;
     

+ 0 - 27
src/FTTHBundle/Validator/ONUPositionValidator.php

@@ -1,27 +0,0 @@
-<?php
-
-namespace FTTHBundle\Validator;
-
-use Symfony\Component\Validator\Context\ExecutionContextInterface;
-use FTTHBundle\Entity\NAP;
-
-class ONUPositionValidator
-{
-
-    /**
-     * @param int $value
-     * @param ExecutionContextInterface $context
-     * @param array $payload
-     */
-    public static function validate($value, ExecutionContextInterface $context, $payload)
-    {
-        if ($value == 0) {
-            $value = $context->getObject()->getNewPosition();
-        }
-        if ($value > NAP::MAX_NUMBER_ONU) {
-            $context->buildViolation('error.max_number_onu_invalid')
-                    ->addViolation();
-        }
-    }
-
-}