Esempio n. 1
0
 /**
  * The validation rules for this model
  *
  * @return void
  * @author Dan Cox
  */
 public static function rules(ClassMetaData $metadata)
 {
     $metadata->addPropertyConstraint('label', new Assert\NotBlank(['message' => 'The Exclusion name is required']));
     $metadata->addPropertyConstraint('label', new Assert\Length(['min' => 2, 'max' => 255, 'minMessage' => 'The Exclusion name must be atleast {{ limit }} characters long', 'maxMessage' => 'The Exclusion name must be no more than {{ limit }} characters long']));
     $metadata->addPropertyConstraint('day', new Assert\NotBlank(['message' => 'You must select a day for the exclusion']));
     $metadata->addPropertyConstraint('times', new Assert\NotBlank(['message' => 'Please specify the times for this exclusion']));
 }
Esempio n. 2
0
 /**
  * Validation Rules
  *
  * @return void
  * @author Dan Cox
  */
 public static function rules(ClassMetaData $metadata)
 {
     $metadata->addPropertyConstraint('name', new Assert\NotBlank(['message' => 'The Name field is required']));
     $metadata->addPropertyConstraint('name', new Assert\Length(['min' => 2, 'max' => 255, 'minMessage' => 'The name field must be atleast {{ limit }} characters long', 'maxMessage' => 'The name field must be no more than {{ limit }} characters long']));
 }
Esempio n. 3
0
 /**
  * The validation rules for this model.
  *
  * @return void
  * @author Dan Cox
  */
 public static function rules(ClassMetaData $metadata)
 {
     $metadata->addPropertyConstraint('label', new Assert\NotBlank(['message' => 'The Activity name is required']));
     $metadata->addPropertyConstraint('label', new Assert\Length(['min' => 2, 'max' => 255, 'minMessage' => 'The Activity name must be atleast {{ limit }} characters long', 'maxMessage' => 'The Activity name must be no more than {{ limit }} characters long']));
     $metadata->addGetterConstraint('optionSelected', new Assert\True(['message' => 'You must set either hours or explicit day/time option']));
 }