Prismic.io PHP kit  3.0.0
Public Member Functions | Static Public Member Functions | List of all members
Prismic\Ref Class Reference

Public Member Functions

 __construct ($id, $ref, $label, $isMasterRef, $maybeScheduledAt=null)
 
 getId ()
 
 getRef ()
 
 getLabel ()
 
 isMasterRef ()
 
 getScheduledAt ()
 
 getScheduledAtTimestamp ()
 
 getScheduledDate ()
 
 __toString ()
 

Static Public Member Functions

static parse ($json)
 

Detailed Description

Embodies a ref to be called on the prismic.io repository. The ref is a prismic.io concept that represents a time on which you wish to query the repository, in the present (the content that is live now, we call this ref the master ref) or in the future (the content that is planned for a future content release).

This is meant to be built during the unmarshaling of the /api document, and is not meant to be used externally except for testing.

Constructor & Destructor Documentation

§ __construct()

Prismic\Ref::__construct (   $id,
  $ref,
  $label,
  $isMasterRef,
  $maybeScheduledAt = null 
)

Constructs a Ref object.

Parameters
string$idthe ID of the release
string$refthe ID of the ref
string$labelthe display label of the ref
bool$isMasterRefis the ref the master ref?
int$maybeScheduledAtIf scheduled, a javascript timestamp in milliseconds otherwise null

Member Function Documentation

§ __toString()

Prismic\Ref::__toString ( )

Returns the ref as a displayable information: the ref's ID.

Returns
string the ref's ID

§ getId()

Prismic\Ref::getId ( )

Returns the ID of the ref

Returns
string the ID of the ref

§ getLabel()

Prismic\Ref::getLabel ( )

Returns the display label of the ref

Returns
string the display label of the ref

§ getRef()

Prismic\Ref::getRef ( )

Returns the reference of the ref

Returns
string the ID of the ref

§ getScheduledAt()

Prismic\Ref::getScheduledAt ( )

Returns the time at which the ref is scheduled, if it is

Returns
int|null Javacript timestamp for the scheduled release or null if not scheduled

§ getScheduledAtTimestamp()

Prismic\Ref::getScheduledAtTimestamp ( )

Return the scheduled time as a unix timestamp

Returns
int|null Unix timestamp for the scheduled release or null if not scheduled

§ getScheduledDate()

Prismic\Ref::getScheduledDate ( )

Return the DateTime of the scheduled release if any

Returns
DateTime|null The release date or null

§ isMasterRef()

Prismic\Ref::isMasterRef ( )

Checks if the ref is the master ref

Returns
boolean true if it is the master ref, false otherwise

§ parse()

static Prismic\Ref::parse (   $json)
static

Parses a ref.

Parameters
$jsonthe json bit retrieved from the API that represents a ref.
Returns
Prismic::Ref the manipulable object for that ref.

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