/** * Get the body of the contents array * * @param array $contents * @return string * @throws MediaObjectException if the body key has not been set */ 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; }
/** * Sets the contents of the media object * * @param array $contents The contents of the media object * @return $this * @static */ public static function withContents($contents) { return \Bootstrapper\MediaObject::withContents($contents); }