Prismic.io PHP kit  3.0.0
Public Member Functions | List of all members
Prismic\Fragment\Date Class Reference
Inheritance diagram for Prismic\Fragment\Date:
Prismic\Fragment\FragmentInterface

Public Member Functions

 __construct ($value)
 
 asHtml ($linkResolver=null)
 
 asText ()
 
 asDateTime ()
 
 formatted ($pattern)
 
 asEpoch ()
 
 getValue ()
 

Detailed Description

This class embodies a date fragment.

Constructor & Destructor Documentation

§ __construct()

Prismic\Fragment\Date::__construct (   $value)

Constructs a Date fragment.

Parameters
string$valuethe date's value

Member Function Documentation

§ asDateTime()

Prismic\Fragment\Date::asDateTime ( )

Builds a DateTime from the Timestamp fragment, for further manipulation in native PHP.

Returns
string a DateTime for the fragment

§ asEpoch()

Prismic\Fragment\Date::asEpoch ( )

Returns the date as an epoch date.

Returns
string the date as an epoch date

§ asHtml()

Prismic\Fragment\Date::asHtml (   $linkResolver = null)

Builds a HTML version of the date.

Parameters
\Prismic\LinkResolver$linkResolverthe link resolver
Returns
string the HTML version of the date

Implements Prismic\Fragment\FragmentInterface.

§ asText()

Prismic\Fragment\Date::asText ( )

Builds a text version of the date.

Returns
string the text version of the date

Implements Prismic\Fragment\FragmentInterface.

§ formatted()

Prismic\Fragment\Date::formatted (   $pattern)

Returns the date following a certain pattern.

Parameters
string$patternthe pattern, as expected by the date function in PHP
Returns
string the date, formatted

§ getValue()

Prismic\Fragment\Date::getValue ( )

Returns the date's value.

Returns
string the date's value

The documentation for this class was generated from the following file: