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

Public Member Functions

 __construct ($url, $kind, $size, $filename, $height, $width)
 
 getHeight ()
 
 getWidth ()
 

Static Public Member Functions

static parse ($json)
 

Detailed Description

This class embodies an image link; it is what is retrieved from the API when a link is created towards an image file. LinkInterface objects can be found in two occasions: as the "$link" variable of a HyperlinkSpan object (which happens when the link is a hyperlink in a StructuredText fragment), or the LinkInterface can also be its own fragment (e.g. for a "related" fragment, that links to a related document).

Constructor & Destructor Documentation

§ __construct()

Prismic\Fragment\Link\ImageLink::__construct (   $url,
  $kind,
  $size,
  $filename,
  $height,
  $width 
)

Constructs an image link.

Parameters
string$urlthe URL of the resource we're linking to
string$kindthe kind of resource it is (document, image, ...)
string$sizethe size of the resource, in bytes
string$filenamethe resource's original filename, in bytes
int$heightthe height of the image
int$widththe width of the image

Member Function Documentation

§ getHeight()

Prismic\Fragment\Link\ImageLink::getHeight ( )

Returns the height of the image.

Returns
int the height of the image

§ getWidth()

Prismic\Fragment\Link\ImageLink::getWidth ( )

Returns the width of the image.

Returns
int the width of the image

§ parse()

static Prismic\Fragment\Link\ImageLink::parse (   $json)
static

Parses a proper bit of unmarshalled JSON into an ImageLink object. This is used internally during the unmarshalling of API calls.

Parameters
\stdClass$jsonthe raw JSON that needs to be transformed into native objects.
Returns
ImageLink the new object that was created form the JSON.

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