First version
This commit is contained in:
parent
7622c3f5fa
commit
8f6b4afe5b
5 changed files with 13 additions and 7 deletions
25
src/Deblan/CsvValidator/Constraints/Csv.php
Normal file
25
src/Deblan/CsvValidator/Constraints/Csv.php
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace Deblan\CsvValidator\Constraints;
|
||||
|
||||
use Symfony\Component\Validator\Constraints\File;
|
||||
|
||||
class Csv extends File
|
||||
{
|
||||
const FIELD_NOT_VALID = 10;
|
||||
const FIELD_NOT_DETECTED = 11;
|
||||
const LINE_NOT_VALID = 12;
|
||||
|
||||
protected static $errorNames = [
|
||||
self::FIELD_NOT_VALID = 'FIELD_NOT_VALID',
|
||||
self::FIELD_NOT_DETECTED = 'FIELD_NOT_DETECTED',
|
||||
self::LINE_NOT_VALID = 'LINE_NOT_VALID',
|
||||
];
|
||||
|
||||
public $fieldsConstraints = [];
|
||||
public $lineConstraints = [];
|
||||
|
||||
public $fieldNotValidMessage = 'The field {{ field }} of the line {{ line }} is not valid. {{ message }}';
|
||||
public $fieldNotDetectedMessage = 'The field {{ field }} of the line {{ line }} is missing.';
|
||||
public $lineNotValidMessage = 'The line {{ line }} is not valid. {{ message }}';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue