Example #1
0
 /**
  * Parses a given StructuredText fragment (for internal use)
  *
  * @param  \stdClass  $json the json bit retrieved from the API that represents a StructuredText fragment.
  *
  * @return \Prismic\Fragment\StructuredText  the manipulable object for that StructuredText fragment.
  */
 public static function parse($json)
 {
     $blocks = array();
     foreach ($json as $blockJson) {
         $maybeBlock = StructuredText::parseBlock($blockJson);
         if (isset($maybeBlock)) {
             array_push($blocks, $maybeBlock);
         }
     }
     return new StructuredText($blocks);
 }