Neuron-PHP

IsDateRange extends IsDate
in package

Validates a DateRange data object.

Tags
see
IsDate

Table of Contents

Properties

$_format  : string

Methods

__construct()  : mixed
isValid()  : bool
Returns true if validation is successful
setFormat()  : $this
validate()  : bool
Abstract method to be implemented by all validators.

Properties

$_format

private string $_format = 'Y-m-d'

Methods

isValid()

Returns true if validation is successful

public isValid(mixed $value) : bool
Parameters
$value : mixed
Return values
bool

setFormat()

public setFormat(mixed $format) : $this
Parameters
$format : mixed
  • Specify the date format to validate to. Defaults to Y-m-d
Return values
$this

validate()

Abstract method to be implemented by all validators.

protected validate(mixed $value) : bool
Parameters
$value : mixed
Return values
bool

        
On this page

Search results