Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
department.php
1<?php
2
4
8
9Loc::loadMessages(__FILE__);
10
11final class Department extends Base
12{
13 public function getData($entityId = 0): array
14 {
15 static $departmentPath = null;
16
17 $result = $this->getMetaResult();
18 $options = $this->getOptions();
19
20 if (
21 $entityId > 0
22 && Loader::includeModule('iblock')
23 && ($res = \CIBlockSection::getByID($entityId))
24 && ($iblockSection = $res->fetch())
25 )
26 {
27 $result['id'] = $entityId;
28 $result['name'] = $iblockSection["NAME"];
29
30 if (
31 empty($options['skipLink'])
32 || !$options['skipLink']
33 )
34 {
35 if ($departmentPath === null)
36 {
37 $departmentPath = (
38 (!isset($options['mobile']) || !$options['mobile'])
39 && (!isset($options['im']) || !$options['im'])
40 ? Path::get('department_path_template')
41 : ''
42 );
43 }
44 if (!empty($departmentPath))
45 {
46 $result['link'] = \CComponentEngine::makePathFromTemplate(
47 $departmentPath,
48 array(
49 "ID" => $entityId
50 )
51 );
52 }
53 }
54 }
55
56 return $result;
57 }
58}
static loadMessages($file)
Definition loc.php:64