Konvertiert den ContentStream in eine Repräsenation die nur aus einem Array besteht

der Javascript LayoutManager kann dies mit unserialize() lesen und daraus widgets erstellen
@return array
506997
public function convertSerialized(ContentStream $cs) {
    $serialized = array();

    
    foreach ($cs->getEntries() as $entry) {
      if ($entry instanceof ContextAware) {
        $entry->setContext($this->context);
      }
      
      $serialized[] = $this->serializeEntry($entry);
    }
    
    return $serialized;
  }
732654
public function getContentItemArray()
    {
        return [
            'content' => $this->content,
            'id' => $this->id,
            'created' => $this->created,
            'updated' => $this->updated,
            'contenttype' => $this->contenttype,
            'language' => $this->language,
            'parentid' => $this->parentid,
            'reply' => $this->reply,
            'forward' => $this->forward,
        ];
    }
1297672
public function getBody()
    {
        $streamResource = fopen('php://memory', 'r+');
        if (is_resource($this->content)) {
            stream_copy_to_stream($this->content, $streamResource);
        } else {
            fwrite($streamResource, $this->content);
        }
        rewind($streamResource);

        return new ContentStream($streamResource);
    }
321328
public function getHeaders()
    {
        $return = array();

        foreach ($this->contents as $key => $value) {
            if (strpos($key, self::$HttpPrefix) === 0) { // @codeCoverageIgnore
                $return[substr($key, strlen(self::$HttpPrefix))] = $value; // @codeCoverageIgnore
            } // @codeCoverageIgnore

            if (in_array($key, self::$HttpCustomHeaders)) {
                $return[$key] = $value;
            }
        }

        return $return;
    }
226409
public function serialize()
    {
        $output = [];
        foreach ($this as $element) {
            $proxy = $element->getProxy();
            $output[] = $proxy->getContenttype() . '/' . $proxy->getSlug();
        }

        return $output;
    }
94673
public function getContents() : string
    {
        $r = false;
        $err = ($this->stream === null || $this->readable === false);

        if ($err === false) {
            $r = stream_get_contents($this->stream);
        }

        if ($err === true || $r === false) {
            // @codeCoverageIgnoreStart
            throw new \RuntimeException("Could not get contents of stream.");
            // @codeCoverageIgnoreEnd
        }

        return $r;
    }
822072
public InputStream getContents() {
        final byte[] copy;
        synchronized (this) {
            final int length = this.contents.length;
            copy = new byte[length];
            System.arraycopy(this.contents, 0, copy, 0, this.contents.length);
        }
        return new ByteArrayInputStream(copy);
    }
505740
public function getContent()
    {
        //Convert non scalar responses
        if ($this->content && !is_scalar($this->content) && !$this->json) {
            $this->toJson();
        }

        if (($this->json || $this->request->wantsJson()) && !is_scalar($this->content)) {
            if ($this->content instanceof Collection) {
                return json_encode($this->content->toArray());
            } else {
                return json_encode((array) $this->content);
            }
        } else {
            return $this->content;
        }
    }
206545
public function getHtmlContent()
    {
        if ($this->htmlContent === null) {
            try {
                if (empty($content = $this->content)) {
                    return $this->htmlContent = false;
                }

                $errors = libxml_use_internal_errors(true);
                $entities = libxml_disable_entity_loader(true);

                $this->htmlContent = new DOMDocument();

                if (mb_detect_encoding($content, 'UTF-8', true) === 'UTF-8') {
                    $content = mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8');
                    $content = preg_replace(
                        '/<head[^>]*>/',
                        '<head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">',
                        $content
                    );
                } elseif (mb_detect_encoding($content, 'SJIS', true) === 'SJIS') {
                    $content = mb_convert_encoding($content, 'HTML-ENTITIES', 'SJIS');
                    $content = preg_replace('/<head[^>]*>/', '<head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=shift_jis">', $content);
                } elseif (mb_detect_encoding($content, 'ISO-8859-1', true) === 'ISO-8859-1') {
                    $content = mb_convert_encoding($content, 'HTML-ENTITIES', 'ISO-8859-1');
                    $content = preg_replace('/<head[^>]*>/', '<head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">', $content);
                }

                $this->htmlContent->loadHTML(trim($content));

                libxml_use_internal_errors($errors);
                libxml_disable_entity_loader($entities);
            } catch (Exception $exception) {
                return $this->htmlContent = false;
            }
        }

        return $this->htmlContent;
    }
1361020
public function getContent()
    {
        if (!$this->layout) {
            throw new InvalidConfigException("Unable to find the requested cms layout '{$this->layout_id}' for nav item page id '{$this->id}'. Make sure your page does not have an old inactive/deleted cms layout selected.");
        }

        $placholders = [];
        foreach ($this->layout->getJsonConfig('placeholders') as $row) {
            foreach ($row as $item) {
                $placholders[$item['var']] = $this->renderPlaceholder($item['var']);
            }
        }
        
        return Yii::$app->view->render($this->layout->view_file, [
            'placeholders' => $placholders,
        ], $this);
    }
869373
public function getContents(){
        if(null === $this->resource){
            throw new Exception\StreamUnavailableException(
                static::EXCEPTION_MSG_UNAVAILABLE
            );
        }

        if(!$this->isReadable()){
            throw new Exception\StreamUnreadableException(
                static::EXCEPTION_MSG_UNREADABLE
            );
        }

        if(false === ($contents = stream_get_contents($this->resource))){
            throw new \RuntimeException("Failed to read stream.");
        }

        return $contents;
    }
1314008
public function getHtmlContent()
    {
        if ($this->htmlContent === null) {
            try {
                if (($content = $this->getContent()) === '') {
                    return $this->htmlContent = false;
                }

                $errors = libxml_use_internal_errors(true);
                $this->htmlContent = new \DOMDocument();

                if ((mb_detect_encoding($content) === 'UTF-8') && mb_check_encoding($content, 'UTF-8')) {
                    $content = mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8');
                    $content = preg_replace('/<head[^>]*>/', '<head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">', $content);
                }

                //Remove all script elements, CDATA sections and comments (thanks https://github.com/jasny)
                //$content = preg_replace(['%<!--(?:[^-]++|-)*?-->|<!\[CDATA\[(?:[^\]]++|\])*?\]\]>%si', '%<script\b(?:"(?:[^"\\\\]++|\\\\.)*+"|\'(?:[^\'\\\\]++|\\\\.)*+\'|[^>"\']++)*>(?:[^<]++|<)*?</\s*script\s*>%si'], '', $content);

                $this->htmlContent->loadHTML($content);
                libxml_use_internal_errors($errors);
            } catch (\Exception $E) {
                return $this->htmlContent = false;
            }
        }

        return $this->htmlContent;
    }
1138996
public function getStreamContentStartOffset()
    {
        if ($this->parent) {
            return $this->streamContentStartPos - $this->parent->streamPartStartPos;
        }
        return $this->streamContentStartPos;
    }
844922
final public function getTransformedBody()
    {
        $encoding = (isset($this->headers["Content-Transfer-Encoding"])) ? $this->headers["Content-Transfer-Encoding"] : "";

        $rawBody = $this->getRawBody();

        switch ($encoding) {
            case "quoted-printable":
                return quoted_printable_decode($rawBody);
                break;
            case "base64":
                return base64_decode($rawBody);
                break;
            default:
                return $rawBody;
        }
    }
619553
public function getContents()
    {
        $file = $this->getPath();

        // Get an unserialize
        $configuration = file_get_contents($file);
        $configuration = unserialize($configuration);

        return $configuration;
    }
1146553
public function getContents() : string
	{
		if (! \is_resource($this->resource))
		{
			throw new Exception\UnreadableStreamException('Stream is not resourceable');
		}

		if (! $this->isReadable())
		{
			throw new Exception\UnreadableStreamException('Stream is not readable');
		}

		$result = \stream_get_contents($this->resource);

		if (false === $result)
		{
			throw new Exception\UnreadableStreamException('Unable to read remainder of the stream');
		}

		return $result;
	}
658470
public function getContents()
    {
        $content = '';
        while(!$this->streamable->isEOF()) {
            $r = $this->streamable->read(1024);
            if ($r == null)
                break;

            $content .= $r;
        }
        
        return $content;
    }