Ref
in package
Embodies a ref to be called on the Prismic repository. The ref is a Prismic 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.
Table of Contents
- $id : string
- The ID of the ref
- $isMasterRef : bool
- Is the ref the master ref?
- $label : string
- The display label of the ref
- $maybeScheduledAt : int|null
- The date and time at which the ref is scheduled, if it is
- $ref : string
- The reference of the ref
- __toString() : string
- Returns the ref as a displayable information: the ref's ID
- getId() : string
- Returns the ID of the ref
- getLabel() : string
- Returns the display label of the ref
- getRef() : string
- Returns the reference of the ref
- getScheduledAt() : int|null
- Returns the time at which the ref is scheduled, if it is This is a 13 digit Javacript timestamp including miliseconds
- getScheduledAtTimestamp() : int|null
- Return the scheduled time as a unix timestamp
- getScheduledDate() : DateTimeImmutable|null
- Return the DateTime of the scheduled release if any
- isMasterRef() : bool
- Checks if the ref is the master ref
- parse() : self
- Parses a ref.
- __construct() : mixed
- Constructs a Ref object.
Properties
$id
The ID of the ref
private
string
$id
$isMasterRef
Is the ref the master ref?
private
bool
$isMasterRef
$label
The display label of the ref
private
string
$label
$maybeScheduledAt
The date and time at which the ref is scheduled, if it is
private
int|null
$maybeScheduledAt
$ref
The reference of the ref
private
string
$ref
Methods
__toString()
Returns the ref as a displayable information: the ref's ID
public
__toString() : string
Return values
string —getId()
Returns the ID of the ref
public
getId() : string
Return values
string —getLabel()
Returns the display label of the ref
public
getLabel() : string
Return values
string —getRef()
Returns the reference of the ref
public
getRef() : string
Return values
string —getScheduledAt()
Returns the time at which the ref is scheduled, if it is This is a 13 digit Javacript timestamp including miliseconds
public
getScheduledAt() : int|null
Return values
int|null —getScheduledAtTimestamp()
Return the scheduled time as a unix timestamp
public
getScheduledAtTimestamp() : int|null
Return values
int|null —getScheduledDate()
Return the DateTime of the scheduled release if any
public
getScheduledDate() : DateTimeImmutable|null
Return values
DateTimeImmutable|null —isMasterRef()
Checks if the ref is the master ref
public
isMasterRef() : bool
Return values
bool —parse()
Parses a ref.
public
static parse(stdClass $json) : self
Parameters
- $json : stdClass
Tags
Return values
self —__construct()
Constructs a Ref object.
private
__construct(string $id, string $ref, string $label, bool $isMasterRef[, int $maybeScheduledAt = null ]) : mixed
Parameters
- $id : string
-
the ID of the release
- $ref : string
-
the ID of the ref
- $label : string
-
the display label of the ref
- $isMasterRef : bool
-
is the ref the master ref?
- $maybeScheduledAt : int = null
-
If scheduled, a javascript timestamp in milliseconds otherwise null