1 | <?php |
||
14 | class AutomatedLinkPageResult extends DataObject { |
||
15 | |||
16 | private static $db = array( |
||
17 | 'OriginalLinkCount' => 'INT', |
||
18 | 'LinksCreatedCount' => 'INT', |
||
19 | 'Links' => 'Text' |
||
20 | ); |
||
21 | |||
22 | private static $has_one = array( |
||
23 | 'Page' => 'SiteTree' |
||
24 | ); |
||
25 | |||
26 | private static $summary_fields = array( |
||
27 | 'Title' => 'Page Title', |
||
28 | 'URLSegment' => 'Page URLSegment', |
||
29 | 'OriginalLinkCount' => 'Amount of links originally', |
||
30 | 'Links' => 'List of automated links present', |
||
31 | 'LinkCount' => 'Amount of links created', |
||
32 | 'TotalLinks' => 'Total Amount of links' |
||
33 | ); |
||
34 | |||
35 | // Disable all permissions to this object no one needs to touch it except the code itself |
||
36 | public function canView($member = null) {return true; } |
||
40 | |||
41 | /** |
||
42 | * Returns the URL of the page we're related to |
||
43 | * |
||
44 | * @return string |
||
45 | */ |
||
46 | public function Title() { |
||
49 | |||
50 | /** |
||
51 | * Returns the URL of the page we're related to |
||
52 | * |
||
53 | * @return string |
||
54 | */ |
||
55 | public function URLSegment() { |
||
58 | |||
59 | /** |
||
60 | * Returns the amount of links created on the page we're related to |
||
61 | * |
||
62 | * @return int |
||
63 | */ |
||
64 | public function LinkCount() { |
||
67 | |||
68 | /** |
||
69 | * Returns the total amount of link the page we're related to has |
||
70 | * |
||
71 | * @return int |
||
72 | */ |
||
73 | public function TotalLinks() { |
||
76 | |||
77 | /** |
||
78 | * If we already have an AutomatedLinkPageResult object for the |
||
79 | * $page specified update it with the new data else create it |
||
80 | * |
||
81 | * @param SiteTree $page |
||
82 | * @return void |
||
83 | */ |
||
84 | public static function add_or_update(SiteTree $page) { |
||
94 | |||
95 | /** |
||
96 | * Delete the records we have that belong to pages that don't exist |
||
97 | * anymore |
||
98 | * |
||
99 | * @return void |
||
100 | */ |
||
101 | public static function remove_old_data() { |
||
104 | } |
||
105 |