mirror of
https://github.com/silverstripe/silverstripe-externallinks.git
synced 2024-10-22 17:05:44 +02:00
43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace SilverStripe\ExternalLinks\Model;
|
|
|
|
use SilverStripe\CMS\Model\SiteTree;
|
|
use SilverStripe\ExternalLinks\Model\BrokenExternalPageTrackStatus;
|
|
use SilverStripe\ExternalLinks\Model\BrokenExternalLink;
|
|
use SilverStripe\Versioned\Versioned;
|
|
use SilverStripe\ORM\DataObject;
|
|
|
|
/**
|
|
* Represents a track for a single page
|
|
* @method SilverStripe\ORM\HasManyList<BrokenExternalLink> BrokenLinks()
|
|
* @method SiteTree Page()
|
|
* @method BrokenExternalPageTrackStatus Status()
|
|
*/
|
|
class BrokenExternalPageTrack extends DataObject
|
|
{
|
|
private static $table_name = 'BrokenExternalPageTrack';
|
|
|
|
private static $db = array(
|
|
'Processed' => 'Boolean'
|
|
);
|
|
|
|
private static $has_one = array(
|
|
'Page' => SiteTree::class,
|
|
'Status' => BrokenExternalPageTrackStatus::class
|
|
);
|
|
|
|
private static $has_many = array(
|
|
'BrokenLinks' => BrokenExternalLink::class
|
|
);
|
|
|
|
/**
|
|
* @return SiteTree
|
|
*/
|
|
public function Page()
|
|
{
|
|
return Versioned::get_by_stage(SiteTree::class, 'Stage')
|
|
->byID($this->PageID);
|
|
}
|
|
}
|