|
Prismic.io PHP kit
3.0.0
|
Public Member Functions | |
| __construct ($id, $uid, $type, $href, array $tags, array $slugs, array $fragments, $data) | |
| getSlug () | |
| containsSlug ($slug) | |
| getId () | |
| getUid () | |
| getType () | |
| getHref () | |
| getTags () | |
| getSlugs () | |
| getData () | |
| getFirstPublicationDate () | |
| getLastPublicationDate () | |
| asDocumentLink () | |
Public Member Functions inherited from Prismic\WithFragments | |
| __construct (array $fragments) | |
| getFragments () | |
| get ($field) | |
| has ($field) | |
| getAll ($field) | |
| getText ($field) | |
| getNumber ($field, $pattern=null) | |
| getGeoPoint ($field) | |
| getBoolean ($field) | |
| getDate ($field, $pattern=null) | |
| getTimestamp ($field) | |
| getHtml ($field, $linkResolver=null) | |
| getImage ($field) | |
| getAllImages ($field) | |
| getImageView ($field, $view=null) | |
| getAllImageViews ($field, $view) | |
| getStructuredText ($field) | |
| getLink ($field) | |
| getGroup ($field) | |
| getSliceZone ($field) | |
| getEmbed ($field) | |
| getColor ($field) | |
| asHtml ($linkResolver=null) | |
Static Public Member Functions | |
| static | parse (\stdClass $json) |
Static Public Member Functions inherited from Prismic\WithFragments | |
| static | parseFragment ($json) |
| static | parseFragments ($json) |
Embodies a document retrieved from the API, which we'll be able to manipulate.
| Prismic\Document::__construct | ( | $id, | |
| $uid, | |||
| $type, | |||
| $href, | |||
| array | $tags, | ||
| array | $slugs, | ||
| array | $fragments, | ||
| $data | |||
| ) |
Constructs a Document object. To be used only for testing purposes, as this gets done during the unmarshalling
| string | $id | the ID of the document |
| string | null | $uid | the user ID of the document |
| string | $type | the type of the document |
| string | $href | the URL of the document in the repository's API |
| array | $tags | the tags used in the document |
| array | $slugs | the slugs used in the document, in the past and today; today's slug is the head |
| json | $data | the raw json retrieved from the server |
| array | $fragments | all the fragments in the document |
| Prismic\Document::asDocumentLink | ( | ) |
Convert the document to a DocumentLink
| Prismic\Document::containsSlug | ( | $slug | ) |
Checks if a given slug is a past or current slug of the document
| string | $slug | the slug to check |
| Prismic\Document::getData | ( | ) |
Returns the raw json data received from the server. Most of the time it's better to use a different helper, but it can be useful for example for newer features not yet integrated in the kit
| Prismic\Document::getFirstPublicationDate | ( | ) |
Return the DateTime this document was first published This property will be null if the document was first published before the feature was released.
| Prismic\Document::getHref | ( | ) |
Returns the URL of the document in the repository's API
| Prismic\Document::getId | ( | ) |
Returns the ID of the document
| Prismic\Document::getLastPublicationDate | ( | ) |
Return the DateTime this document was last published This property will be null if the document was last published before the feature was released.
| Prismic\Document::getSlug | ( | ) |
Returns the current slug of the document
| Prismic\Document::getSlugs | ( | ) |
Returns the slugs used in the document, in the past and today; today's slug is the head. Your can use getSlug() if you need just the current slug.
| Prismic\Document::getTags | ( | ) |
Returns the tags in the document
| Prismic\Document::getType | ( | ) |
Returns the type of the document
| Prismic\Document::getUid | ( | ) |
Returns the user ID of the document, a unique but human-readable identifier typically to be used in URLs.
It can be null, if the uid is not declared in the document mask.
|
static |
Parses a given document. Not meant to be used except for testing.
| $json | the json bit retrieved from the API that represents a document. |
1.8.12