Guest User

Untitled

a guest
Nov 20th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. public function validate($value, Constraint $constraint)
  2. {
  3. $closedDays = ['Tue', 'Sun'];
  4. $day = date('D', $value->getTimeStamp());
  5. foreach( $closedDays as $closedDay) {
  6. if ($day === $closedDay) {
  7. $this->context->buildViolation($constraint->message)
  8. ->addViolation();
  9. }
  10.  
  11. }
  12. }
Add Comment
Please, Sign In to add comment