1 | <?php |
||
9 | class Addon extends DataObject |
||
10 | { |
||
11 | |||
12 | public static $db = array( |
||
13 | 'Name' => 'Varchar(255)', |
||
14 | 'Description' => 'Text', |
||
15 | 'Type' => 'Varchar(100)', |
||
16 | 'Readme' => 'HTMLText', |
||
17 | 'Released' => 'SS_Datetime', |
||
18 | 'Repository' => 'Varchar(255)', |
||
19 | 'Downloads' => 'Int', |
||
20 | 'DownloadsMonthly' => 'Int', |
||
21 | 'Favers' => 'Int', |
||
22 | 'LastUpdated' => 'SS_Datetime', |
||
23 | 'LastBuilt' => 'SS_Datetime', |
||
24 | 'BuildQueued' => 'Boolean', |
||
25 | 'Abandoned' => 'Text', |
||
26 | // Module rating information |
||
27 | 'Rating' => 'Int', |
||
28 | 'RatingDetails' => 'Text', |
||
29 | // Commercially supported by SilverStripe Ltd. |
||
30 | 'Supported' => 'Boolean', |
||
31 | ); |
||
32 | |||
33 | public static $has_one = array( |
||
34 | 'Vendor' => 'AddonVendor', |
||
35 | ); |
||
36 | |||
37 | public static $has_many = array( |
||
38 | 'Versions' => 'AddonVersion' |
||
39 | ); |
||
40 | |||
41 | public static $many_many = array( |
||
42 | 'Keywords' => 'AddonKeyword', |
||
43 | 'Screenshots' => 'Image', |
||
44 | 'CompatibleVersions' => 'SilverStripeVersion' |
||
45 | ); |
||
46 | |||
47 | public static $default_sort = 'Name'; |
||
48 | |||
49 | public static $extensions = array( |
||
50 | 'SilverStripe\\Elastica\\Searchable' |
||
51 | ); |
||
52 | |||
53 | /** |
||
54 | * Gets the addon's versions sorted from newest to oldest. |
||
55 | * |
||
56 | * @return ArrayList |
||
57 | */ |
||
58 | public function SortedVersions() |
||
68 | |||
69 | public function MasterVersion() |
||
73 | |||
74 | public function Authors() |
||
78 | |||
79 | public function VendorName() |
||
83 | |||
84 | public function VendorLink() |
||
92 | |||
93 | public function PackageName() |
||
97 | |||
98 | public function Link() |
||
106 | |||
107 | public function DescriptionText() |
||
111 | |||
112 | public function RSSTitle() |
||
116 | |||
117 | public function PackagistUrl() |
||
121 | |||
122 | public function getElasticaMapping() |
||
136 | |||
137 | public function getElasticaDocument() |
||
151 | |||
152 | public function onBeforeDelete() |
||
170 | |||
171 | public function getDateCreated() |
||
175 | |||
176 | /** |
||
177 | * Returns unserialised result data from the ratings check suite |
||
178 | * |
||
179 | * {@see \SilverStripe\ModuleRatings\CheckSuite} |
||
180 | * |
||
181 | * @return ArrayData |
||
182 | */ |
||
183 | public function RatingData() |
||
190 | |||
191 | /** |
||
192 | * Returns a list of whether rating metrics have passed for this addon, and a description of the metric |
||
193 | * |
||
194 | * @return ArrayList |
||
195 | */ |
||
196 | public function RatingDescriptions() |
||
215 | |||
216 | |||
217 | |||
218 | /** |
||
219 | * |
||
220 | * @return bool|DateInterval |
||
221 | */ |
||
222 | public function addonAge() |
||
229 | |||
230 | /** |
||
231 | * Calculate the total amount of downloads per day |
||
232 | * Based on the total amount of downloads divided by the age of the addon |
||
233 | * |
||
234 | * @return float |
||
235 | */ |
||
236 | public function getRelativePopularity() |
||
240 | |||
241 | /** |
||
242 | * Format the relative popularity to a nicely readable number |
||
243 | * |
||
244 | * @return string |
||
245 | */ |
||
246 | public function relativePopularityFormatted() |
||
250 | } |
||
251 |
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.