Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
group.php
1<?php
10
11
14
15class Group extends EntityBase
16{
17 private static $modelsCache = [];
18
19 public function getType(): string
20 {
21 return AccessCode::TYPE_GROUP;
22 }
23
24 public function getName(): string
25 {
26 if ($this->model)
27 {
28 return $this->model->getName();
29 }
30 return '';
31 }
32
33 public function getUrl(): string
34 {
35 return '';
36 }
37
38 public function getAvatar(int $width = 58, int $height = 58): ?string
39 {
40 return '';
41 }
42
43 protected function loadModel()
44 {
45 if (!$this->model)
46 {
47 if (array_key_exists($this->id, self::$modelsCache))
48 {
49 $this->model = self::$modelsCache[$this->id];
50 }
51 else
52 {
53 $this->model = GroupTable::getList([
54 'select' => [
55 'ID',
56 'NAME',
57 ],
58 'filter' => [
59 '=ID' => $this->id,
60 ],
61 'limit' => 1,
62 ])->fetchObject();
63
64 self::$modelsCache[$this->id] = $this->model;
65 }
66 }
67 }
68}
static getList(array $parameters=array())
getAvatar(int $width=58, int $height=58)
Definition group.php:38