File: RemoteDocument.php

package info (click to toggle)
php-ml-json-ld 1.2.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 628 kB
  • sloc: php: 4,521; makefile: 21
file content (57 lines) | stat: -rw-r--r-- 1,520 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php

/*
 * (c) Markus Lanthaler <mail@markus-lanthaler.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace ML\JsonLD;

/**
 * RemoteDocument
 *
 * @author Markus Lanthaler <mail@markus-lanthaler.com>
 */
class RemoteDocument
{
    /**
     * @var string The URL of the loaded document.
     */
    public $documentUrl;

    /**
     * @var string The document's media type
     */
    public $mediaType;

    /**
     * @var mixed The retrieved document. This can either be the raw payload
     *            or the already parsed document.
     */
    public $document;

    /**
     * @var string|null The value of the context Link header if available;
     *                  otherwise null.
     */
    public $contextUrl;

    /**
     * Constructor
     *
     * @param null|string $documentUrl The final URL of the loaded document.
     * @param mixed       $document    The retrieved document (parsed or raw).
     * @param null|string $mediaType   The document's media type.
     * @param null|string $contextUrl  The value of the context Link header
     *                                 if available; otherwise null.
     */
    public function __construct($documentUrl = null, $document = null, $mediaType = null, $contextUrl = null)
    {
        $this->documentUrl = $documentUrl;
        $this->document = $document;
        $this->mediaType = $mediaType;
        $this->contextUrl = $contextUrl;
    }
}