protected function getBody(array $contents) { if (!isset($contents['body'])) { throw new MediaObjectException('You must pass in the body to each object'); } $string = $contents['body']; if (isset($contents['nest'])) { $object = new MediaObject(); $string .= $object->withContents($contents['nest']); } return $string; }