Retry-After HTTP Header

link http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.37
package Default
inherited_from \Zend\Http\Header\AbstractDate

 Methods

Allow casting to string

__toString() : string
Inherited

Returns

string

Compare provided date to date for this header Returns < 0 if date in header is less than $date; > 0 if it's greater, and 0 if they are equal.

compareTo(string|\DateTime $date) : integer
Inherited
see

Parameters

$date

string\DateTime

Exceptions

\Zend\Http\Header\Exception\InvalidArgumentException

Returns

integer

Return date for this header as an instance of \DateTime

date() : \DateTime
Inherited

Returns

\DateTime

Create Retry-After header from string

fromString(string $headerLine) : \Zend\Http\Header\RetryAfter
Static
inherited_from \Zend\Http\Header\AbstractDate::fromString()

Parameters

$headerLine

string

Exceptions

\Zend\Http\Header\Exception\InvalidArgumentException

Returns

\Zend\Http\Header\RetryAfter

Create date-based header from string

fromString(string $headerLine) : \Zend\Http\Header\AbstractDate
InheritedStatic
inherited_from \Zend\Http\Header\HeaderInterface::fromString()

Parameters

$headerLine

string

Exceptions

\Zend\Http\Header\Exception\InvalidArgumentException

Returns

\Zend\Http\Header\AbstractDate

Create date-based header from strtotime()-compatible string

fromTimeString(integer|string $time) : \Zend\Http\Header\RetryAfter
InheritedStatic
fluent This method is part of a fluent interface and will return the same instance

Parameters

$time

integerstring

Exceptions

\Zend\Http\Header\Exception\InvalidArgumentException

Returns

\Zend\Http\Header\RetryAfter

Create date-based header from Unix timestamp

fromTimestamp(integer $time) : \Zend\Http\Header\RetryAfter
InheritedStatic
fluent This method is part of a fluent interface and will return the same instance

Parameters

$time

integer

Exceptions

\Zend\Http\Header\Exception\InvalidArgumentException

Returns

\Zend\Http\Header\RetryAfter

Return date for this header

getDate() : string
Inherited

Returns

string

Return current date output format

getDateFormat() : string
InheritedStatic

Returns

string

Get number of seconds

getDeltaSeconds() : integer

Returns

integer

Get header name

getFieldName() : string

Returns

string

Returns date if it's set, or number of seconds

getFieldValue() : integer | string
inherited_from \Zend\Http\Header\AbstractDate::getFieldValue()

Returns

integerstring

Get header value as formatted date

getFieldValue() : string
Inherited
inherited_from \Zend\Http\Header\HeaderInterface::getFieldValue()

Returns

string

Set the date for this header, this can be a string or an instance of \DateTime

setDate(string|\DateTime $date) : \Zend\Http\Header\AbstractDate
Inherited

Parameters

$date

string\DateTime

Exceptions

\Zend\Http\Header\Exception\InvalidArgumentException

Returns

\Zend\Http\Header\AbstractDate

Set date output format

setDateFormat(integer $format) 
InheritedStatic

Parameters

$format

integer

Exceptions

\Zend\Http\Header\Exception\InvalidArgumentException

Set number of seconds

setDeltaSeconds(integer $delta) : \Zend\Http\Header\RetryAfter

Parameters

$delta

integer

Returns

\Zend\Http\Header\RetryAfter

Return header line

toString() : string

Returns in form of "NAME: VALUE"

inherited_from \Zend\Http\Header\AbstractDate::toString()

Returns

string

Return header line

toString() : string
Inherited

Returns in form of "NAME: VALUE"

inherited_from \Zend\Http\Header\HeaderInterface::toString()

Returns

string

 Properties

 

Date instance for this header

$date : \DateTime

Default

null
 

Date output format

$dateFormat : string

Default

'D, d M Y H:i:s \G\M\T'
Static
 

Date formats defined by RFC 2616. RFC 1123 date is required RFC 1036 and ANSI C formats are provided for compatibility with old servers/clients

$dateFormats : array

Default

array(self::DATE_RFC1123 => 'D, d M Y H:i:s \G\M\T', self::DATE_RFC1036 => 'D, d M y H:i:s \G\M\T', self::DATE_ANSIC => 'D M j H:i:s Y')
Static
 

Value of header in delta-seconds By default set to 1 hour

$deltaSeconds : integer

Default

3600

 Constants

 

DATE_ANSIC

DATE_ANSIC = 2 
 

DATE_RFC1036

DATE_RFC1036 = 1 
 

Date formats according to RFC 2616

DATE_RFC1123 = 0