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

Public Member Functions

 __construct ($type, $provider, $url, $maybeWidth, $maybeHeigth, $maybeHtml, $oembedJson)
 
 asHtml ($linkResolver=null)
 
 getType ()
 
 getProvider ()
 
 getUrl ()
 
 getWidth ()
 
 getHeight ()
 
 getOEmbedJson ()
 
 asText ()
 

Static Public Member Functions

static parse ($json)
 

Detailed Description

This class embodies an Embed fragment.

Constructor & Destructor Documentation

§ __construct()

Prismic\Fragment\Embed::__construct (   $type,
  $provider,
  $url,
  $maybeWidth,
  $maybeHeigth,
  $maybeHtml,
  $oembedJson 
)

Constructs an Embed fragment.

Parameters
string$typethe OEmbed resource's type
string$providerthe OEmbed resource's provider
string$urlthe OEmbed resource's URL
string$maybeWidththe OEmbed resource's width
string$maybeHeigththe OEmbed resource's height
string$maybeHtmlthe OEmbed resource's HTML
string$oembedJsonthe OEmbed resource's JSON

Member Function Documentation

§ asHtml()

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

Builds a HTML version of the Embed fragment.

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

Implements Prismic\Fragment\FragmentInterface.

§ asText()

Prismic\Fragment\Embed::asText ( )

Get the full JSON oEmbed code.

Returns
string the text version of the Embed fragment

Implements Prismic\Fragment\FragmentInterface.

§ getHeight()

Prismic\Fragment\Embed::getHeight ( )

Get the the OEmbed height

Returns
string

§ getOEmbedJson()

Prismic\Fragment\Embed::getOEmbedJson ( )

Get the the OEmbed resource's JSON.

Returns

§ getProvider()

Prismic\Fragment\Embed::getProvider ( )

Get the the OEmbed provider

Returns
string

§ getType()

Prismic\Fragment\Embed::getType ( )

Get the the OEmbed type

Returns
string

§ getUrl()

Prismic\Fragment\Embed::getUrl ( )

Get the the OEmbed url

Returns
string

§ getWidth()

Prismic\Fragment\Embed::getWidth ( )

Get the the OEmbed width

Returns
string

§ parse()

static Prismic\Fragment\Embed::parse (   $json)
static

Parses a given Embed fragment. Not meant to be used except for testing.

Parameters
\stdClass$jsonthe json bit retrieved from the API that represents an Embed fragment.
Returns
the manipulable object for that Embed fragment.

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