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