MemoryDocument.php
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2020 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of the MIT License.
7  *
8  * See the LICENSE file distributed with this work for
9  * additional information.
10  */
12 
13 /**
14  * MemoryDocument represents content that resides in memory.
15  *
16  * @author ingo herwig <ingo@wemove.com>
17  */
19 
20  private $content = '';
21 
22  /**
23  * Constructor
24  * @param $content
25  * @param $mimeType
26  * @param $isDownload
27  * @param $filename
28  */
29  public function __construct($content, $mimeType, $isDownload, $filename) {
30  $this->content = $content;
31  parent::__construct($mimeType, $isDownload, $filename);
32  }
33 
34  /**
35  * @see ResponseDocument::getContent()
36  */
37  public function getContent() {
38  return $this->content;
39  }
40 
41  /**
42  * @see ResponseDocument::output()
43  */
44  public function output() {
45  echo $this->content;
46  }
47 }
48 ?>
AbstractFormat is used as base class for specialized documents.
MemoryDocument represents content that resides in memory.
__construct($content, $mimeType, $isDownload, $filename)
Constructor.