src/Model/Table/Table.php
public function validateTime($value, $options = [], array $context = []) {
		if (!$value) {
			return false;
		}
		$dateTime = explode(' ', $value, 2);
		$value = array_pop($dateTime);

		if (Validation::time($value)) {
			// after/before?
			if (!empty($options['after']) && isset($context['data'][$options['after']])) {
				if ($context['data'][$options['after']] >= $value) {
					return false;
				}
			}
			if (!empty($options['before']) && isset($context['data'][$options['before']])) {
				if ($context['data'][$options['before']] <= $value) {
					return false;
				}
			}
			return true;
		}
		return false;
	}
public function validateTime($value, $options = [], array $context = []) {
		if (!$value) {
			return false;
		}
		$dateTime = explode(' ', $value, 2);
		$value = array_pop($dateTime);

		if (Validation::time($value)) {
			// after/before?
			if (!empty($options['after']) && isset($context['data'][$options['after']])) {
				if ($context['data'][$options['after']] >= $value) {
					return false;
				}
			}
			if (!empty($options['before']) && isset($context['data'][$options['before']])) {
				if ($context['data'][$options['before']] <= $value) {
					return false;
				}
			}
			return true;
		}
		return false;
	}
public function validateTime ( $ value , $ options = [ ] , array $ context = [ ] ) { if ( ! $ value ) { return false ; } $ dateTime = explode ( ' ' , $ value , 2 ) ; $ value = array_pop ( $ dateTime ) ; if ( Validation :: time ( $ value ) ) { // after/before? if ( ! empty ( $ options [ 'after' ] ) && isset ( $ context [ 'data' ] [ $ options [ 'after' ] ] ) ) { if ( $ context [ 'data' ] [ $ options [ 'after' ] ] >= $ value ) { return false ; } } if ( ! empty ( $ options [ 'before' ] ) && isset ( $ context [ 'data' ] [ $ options [ 'before' ] ] ) ) { if ( $ context [ 'data' ] [ $ options [ 'before' ] ] <= $ value ) { return false ; } } return true ; } return false ; }
Validation of Time fields

@param mixed $value
@param array $options
- timeFormat (defaults to 'hms')
- allowEmpty
- after/before (fieldName to validate against)
- min/max (defaults to >= 1 - at least 1 minute apart)
@param array $context
@return bool Success
Validation of Time fields