xref: /dokuwiki/inc/Remote/Response/Link.php (revision 6cce3332fbc12c1e250ec7e6adbad6d4dc2c74e8)
1*6cce3332SAndreas Gohr<?php
2*6cce3332SAndreas Gohr
3*6cce3332SAndreas Gohrnamespace dokuwiki\Remote\Response;
4*6cce3332SAndreas Gohr
5*6cce3332SAndreas Gohrclass Link extends ApiResponse
6*6cce3332SAndreas Gohr{
7*6cce3332SAndreas Gohr    /** @var string The type of this link: `internal`, `external` or `interwiki` */
8*6cce3332SAndreas Gohr    public $type;
9*6cce3332SAndreas Gohr    /** @var string The wiki page this link points to, same as `href` for external links */
10*6cce3332SAndreas Gohr    public $page;
11*6cce3332SAndreas Gohr    /** @var string A hyperlink pointing to the linked target */
12*6cce3332SAndreas Gohr    public $href;
13*6cce3332SAndreas Gohr
14*6cce3332SAndreas Gohr
15*6cce3332SAndreas Gohr
16*6cce3332SAndreas Gohr    public function __construct($data)
17*6cce3332SAndreas Gohr    {
18*6cce3332SAndreas Gohr        $this->type = $data['type'] ?? '';
19*6cce3332SAndreas Gohr        $this->page = $data['page'] ?? '';
20*6cce3332SAndreas Gohr        $this->href = $data['href'] ?? '';
21*6cce3332SAndreas Gohr    }
22*6cce3332SAndreas Gohr}
23