Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
baserole.php
1<?php
2
4
6
7abstract class BaseRole extends BaseProperty implements RoleEntityInterface
8{
9 public const TYPE = 'user';
10 protected string $name = '';
11 protected ?int $id = null;
12
13 public static function createInstance(string $name): RoleEntityInterface
14 {
15 return new static($name);
16 }
17
18 public function __construct(string $name)
19 {
20 $this->name = $name;
21 }
22
26 public function toString(): string
27 {
28 return $this->getFullName();
29 }
30
34 public function getFields(): array
35 {
36 return [
37 'name',
38 'id',
39 ];
40 }
41
45 public function getFullName(): string
46 {
47 return $this->name;
48 }
49
53 public function getId(): ?int
54 {
55 return $this->id;
56 }
57
61 public function getType(): string
62 {
63 return static::TYPE;
64 }
65
70 public function setName(string $name): BaseRole
71 {
72 $this->name = $name;
73
74 return $this;
75 }
76
81 public function setId(?int $id): BaseRole
82 {
83 $this->id = $id;
84
85 return $this;
86 }
87}
static createInstance(string $name)
Definition baserole.php:13