withContents() публичный Метод

Sets the contents of the media object
public withContents ( array $contents )
$contents array The contents of the media object
Пример #1
0
 /**
  * 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;
 }
Пример #2
0
 /**
  * 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);
 }