Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function validate($value, Constraint $constraint)
- {
- $closedDays = ['Tue', 'Sun'];
- $day = date('D', $value->getTimeStamp());
- foreach( $closedDays as $closedDay) {
- if ($day === $closedDay) {
- $this->context->buildViolation($constraint->message)
- ->addViolation();
- }
- }
- }
Add Comment
Please, Sign In to add comment