-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add perception validator + summary detail validations
- Loading branch information
Showing
8 changed files
with
67 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: Administrador | ||
* Date: 24/01/2018 | ||
* Time: 11:34 AM | ||
*/ | ||
|
||
namespace Greenter\Validator\Loader; | ||
|
||
use Greenter\Validator\LoaderMetadataInterface; | ||
use Symfony\Component\Validator\Mapping\ClassMetadata; | ||
use Symfony\Component\Validator\Constraints as Assert; | ||
|
||
/** | ||
* Class SummaryPerceptionLoader | ||
*/ | ||
class SummaryPerceptionLoader implements LoaderMetadataInterface | ||
{ | ||
public function load(ClassMetadata $metadata) | ||
{ | ||
$metadata->addPropertyConstraints('codReg', [ | ||
new Assert\NotBlank(), | ||
new Assert\Choice([ | ||
'choices' => ['01', '02', '03'], | ||
]), | ||
]); | ||
$metadata->addPropertyConstraint('tasa', new Assert\NotBlank()); | ||
$metadata->addPropertyConstraint('mtoBase', new Assert\NotBlank()); | ||
$metadata->addPropertyConstraint('mto', new Assert\NotBlank()); | ||
$metadata->addPropertyConstraint('mtoTotal', new Assert\NotBlank()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters