Documentation

CastToDate
in package
implements TypeCasting

FinalYes
Tags
implements

Table of Contents

Interfaces

TypeCasting

Properties

$class  : class-string
$default  : DateTimeImmutable|DateTime|null
$format  : string|null
$info  : TypeCastingInfo
$isNullable  : bool
$timezone  : DateTimeZone|null
$type  : Type

Methods

__construct()  : mixed
info()  : TypeCastingInfo
setOptions()  : void
Accepts additional parameters to configure the class Parameters should be scalar value, null or array containing only scalar value and null.
toVariable()  : TValue
cast()  : DateTimeImmutable|DateTime
init()  : DateTimeInterface>, 2: bool}

Properties

$default

private DateTimeImmutable|DateTime|null $default = null

$timezone

private DateTimeZone|null $timezone = null

Methods

__construct()

public __construct(ReflectionProperty|ReflectionParameter $reflectionProperty) : mixed
Parameters
$reflectionProperty : ReflectionProperty|ReflectionParameter
Tags
throws
MappingFailed

setOptions()

Accepts additional parameters to configure the class Parameters should be scalar value, null or array containing only scalar value and null.

public setOptions([string|null $default = null ][, string|null $format = null ][, DateTimeZone|string|null $timezone = null ][, class-string|null $className = null ]) : void
Parameters
$default : string|null = null
$format : string|null = null
$timezone : DateTimeZone|string|null = null
$className : class-string|null = null
Tags
throws
MappingFailed

cast()

private cast(mixed $value) : DateTimeImmutable|DateTime
Parameters
$value : mixed
Tags
throws
TypeCastingFailed
Return values
DateTimeImmutable|DateTime

init()

private init(ReflectionProperty|ReflectionParameter $reflectionProperty) : DateTimeInterface>, 2: bool}
Parameters
$reflectionProperty : ReflectionProperty|ReflectionParameter
Tags
throws
MappingFailed
Return values
DateTimeInterface>, 2: bool}

        
On this page

Search results