| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function getHierarchy() |
||
| 18 | { |
||
| 19 | $focus = CRMEntity::getInstance($this->getModuleName()); |
||
| 20 | $hierarchy = $focus->getHierarchy($this->getId()); |
||
|
|
|||
| 21 | foreach ($hierarchy['entries'] as $competitionId => $data) { |
||
| 22 | preg_match('/<a href="+/', $data[0], $matches); |
||
| 23 | if (!empty($matches)) { |
||
| 24 | preg_match('/[.\s]+/', $data[0], $dashes); |
||
| 25 | preg_match('/<a(.*)>(.*)<\\/a>/i', $data[0], $name); |
||
| 26 | |||
| 27 | $recordModel = Vtiger_Record_Model::getCleanInstance('Competition'); |
||
| 28 | $recordModel->setId($competitionId); |
||
| 29 | $hierarchy['entries'][$competitionId][0] = ($dashes[0] ?? '') . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $name[2] . |
||
| 30 | '</a>'; |
||
| 31 | } |
||
| 32 | } |
||
| 33 | return $hierarchy; |
||
| 34 | } |
||
| 36 |