aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc/Remote/Response/Link.php
blob: 89c284fc03289e034fa6eddba7dca36c289565bb (plain) (blame)
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
<?php

namespace dokuwiki\Remote\Response;

class Link extends ApiResponse
{
    /** @var string The type of this link: `internal`, `external` or `interwiki` */
    public $type;
    /** @var string The wiki page this link points to, same as `href` for external links */
    public $page;
    /** @var string A hyperlink pointing to the linked target */
    public $href;

    /**
     * @param string $type One of `internal`, `external` or `interwiki`
     * @param string $page The wiki page this link points to, same as `href` for external links
     * @param string $href A hyperlink pointing to the linked target
     */
    public function __construct($type, $page, $href)
    {
        $this->type = $type;
        $this->page = $page;
        $this->href = $href;
    }

    /** @inheritdoc */
    public function __toString()
    {
        return $this->href;
    }
}