Conditions | 4 |
Paths | 4 |
Total Lines | 25 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 15 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | public function getExportFields(): array |
||
19 | { |
||
20 | if (Permission::check('ADMIN')) { |
||
21 | //set to ten minutes |
||
22 | Environment::setTimeLimitMax(600); |
||
23 | $singleton = Injector::inst()->get($this->modelClass); |
||
24 | if ($singleton) { |
||
25 | $obj = AllFields::create($this->modelClass); |
||
26 | $this->exportFields = $obj->getExportFields(); |
||
|
|||
27 | if ($singleton->hasMethod('getFieldsToIncludeInExport')) { |
||
28 | $this->exportFields += $singleton->getFieldsToIncludeInExport(); |
||
29 | } |
||
30 | // if(Director::isDev()) { |
||
31 | // foreach($this->exportFields as $fieldName => $title) { |
||
32 | // echo "\n'$fieldName',"; |
||
33 | // } |
||
34 | // } |
||
35 | } else { |
||
36 | $this->exportFields = parent::getExportFields(); |
||
37 | } |
||
38 | } else { |
||
39 | $this->exportFields = parent::getExportFields(); |
||
40 | } |
||
41 | |||
42 | return $this->exportFields; |
||
43 | } |
||
45 |