AbstractDocument.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 
14 
15 /**
16  * AbstractFormat is used as base class for specialized documents.
17  *
18  * @author ingo herwig <ingo@wemove.com>
19  */
20 abstract class AbstractDocument implements ResponseDocument {
21 
22  private $mimeType = 'application/octet-stream';
23  private $isDownload = false;
24  private $filename = '';
25 
26  /**
27  * Constructor
28  * @param $mimeType
29  * @param $isDownload
30  * @param $filename
31  */
32  public function __construct($mimeType, $isDownload, $filename) {
33  $this->mimeType = $mimeType;
34  $this->isDownload = $isDownload;
35  $this->filename = $filename;
36  }
37 
38  /**
39  * @see ResponseDocument::getMimeType()
40  */
41  public function getMimeType() {
42  return $this->mimeType;
43  }
44 
45  /**
46  * @see ResponseDocument::isDownload()
47  */
48  public function isDownload() {
49  return $this->isDownload;
50  }
51 
52  /**
53  * @see ResponseDocument::getFilename()
54  */
55  public function getFilename() {
56  return $this->filename;
57  }
58 
59  /**
60  * @see ResponseDocument::getCacheDate()
61  */
62  public function getCacheDate() {
63  return null;
64  }
65 }
66 ?>
AbstractFormat is used as base class for specialized documents.
__construct($mimeType, $isDownload, $filename)
Constructor.
ResponseDocument is the interface for media returned in a response when using the DownloadFormat.