File: Link.php

package info (click to toggle)
dokuwiki 2024-02-06b%2Bdfsg-9
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 24,624 kB
  • sloc: php: 97,851; javascript: 3,724; sh: 599; makefile: 70; xml: 34
file content (31 lines) | stat: -rw-r--r-- 877 bytes parent folder | download | duplicates (3)
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;
    }
}