First version

This commit is contained in:
Simon Vieille 2016-05-20 12:01:26 +02:00
commit 8f6b4afe5b
5 changed files with 13 additions and 7 deletions

View 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 }}';
}