Example #1
0
 /**
  * Parses a given image view fragment. Not meant to be used except for testing.
  *
  * @param  \stdClass                    $json the json bit retrieved from the API that represents an image view.
  * @return \Prismic\Fragment\ImageView  the manipulable object for that image view.
  */
 public static function parse($json)
 {
     return new ImageView($json->url, $json->alt, $json->copyright, $json->dimensions->width, $json->dimensions->height, isset($json->linkTo) ? StructuredText::extractLink($json->linkTo) : null);
 }