src/ChangeSetItem.php
public function getPreviewLinks()
    {
        $links = [];

        // Preview draft
        $stage = $this->getObjectInStage(Versioned::DRAFT);
        if ($stage instanceof CMSPreviewable && $stage->canView() && ($link = $stage->PreviewLink())) {
            $links[Versioned::DRAFT] = [
                'href' => Controller::join_links($link, '?stage=' . Versioned::DRAFT),
                'type' => $stage->getMimeType(),
            ];
        }

        // Preview live if versioned
        if ($this->isVersioned()) {
            $live = $this->getObjectInStage(Versioned::LIVE);
            if ($live instanceof CMSPreviewable && $live->canView() && ($link = $live->PreviewLink())) {
                $links[Versioned::LIVE] = [
                'href' => Controller::join_links($link, '?stage=' . Versioned::LIVE),
                'type' => $live->getMimeType(),
                ];
            }
        }

        return $links;
    }
public function getPreviewLinks()
    {
        $links = [];

        // Preview draft
        $stage = $this->getObjectInStage(Versioned::DRAFT);
        if ($stage instanceof CMSPreviewable && $stage->canView() && ($link = $stage->PreviewLink())) {
            $links[Versioned::DRAFT] = [
                'href' => Controller::join_links($link, '?stage=' . Versioned::DRAFT),
                'type' => $stage->getMimeType(),
            ];
        }

        // Preview live if versioned
        if ($this->isVersioned()) {
            $live = $this->getObjectInStage(Versioned::LIVE);
            if ($live instanceof CMSPreviewable && $live->canView() && ($link = $live->PreviewLink())) {
                $links[Versioned::LIVE] = [
                'href' => Controller::join_links($link, '?stage=' . Versioned::LIVE),
                'type' => $live->getMimeType(),
                ];
            }
        }

        return $links;
    }
public function getPreviewLinks ( ) { $ links = [ ] ; // Preview draft $ stage = $ this -> getObjectInStage ( Versioned :: DRAFT ) ; if ( $ stage instanceof CMSPreviewable && $ stage -> canView ( ) && ( $ link = $ stage -> PreviewLink ( ) ) ) { $ links [ Versioned :: DRAFT ] = [ 'href' => Controller :: join_links ( $ link , '?stage=' . Versioned :: DRAFT ) , 'type' => $ stage -> getMimeType ( ) , ] ; } // Preview live if versioned if ( $ this -> isVersioned ( ) ) { $ live = $ this -> getObjectInStage ( Versioned :: LIVE ) ; if ( $ live instanceof CMSPreviewable && $ live -> canView ( ) && ( $ link = $ live -> PreviewLink ( ) ) ) { $ links [ Versioned :: LIVE ] = [ 'href' => Controller :: join_links ( $ link , '?stage=' . Versioned :: LIVE ) , 'type' => $ live -> getMimeType ( ) , ] ; } } return $ links ; }
Gets the list of modes this record can be previewed in.

{@link https://tools.ietf.org/html/draft-kelly-json-hal-07#section-5}

@return array Map of links in acceptable HAL format
Gets the list of modes this record can be previewed in .