1 | <?php |
||
23 | class Permission extends AbstractModel implements CategorizableInterface |
||
|
|||
24 | { |
||
25 | use CategorizableTrait; |
||
26 | use TranslatorAwareTrait; |
||
27 | |||
28 | /** |
||
29 | * @var string|null |
||
30 | */ |
||
31 | private $ident; |
||
32 | |||
33 | /** |
||
34 | * @var \Charcoal\Translator\Translation|null |
||
35 | */ |
||
36 | private $name; |
||
37 | |||
38 | /** |
||
39 | * Permission can be used as a string (ident). |
||
40 | * |
||
41 | * @return string |
||
42 | */ |
||
43 | public function __toString() |
||
50 | |||
51 | /** |
||
52 | * @return string |
||
53 | */ |
||
54 | public function key() |
||
58 | |||
59 | /** |
||
60 | * @param string $ident The permission identifier. |
||
61 | * @throws InvalidArgumentException If the ident is not a string. |
||
62 | * @return self |
||
63 | */ |
||
64 | public function setIdent($ident) |
||
74 | |||
75 | /** |
||
76 | * @return string|null |
||
77 | */ |
||
78 | public function getIdent() |
||
79 | { |
||
80 | return $this->ident; |
||
81 | } |
||
82 | |||
83 | /** |
||
84 | * @param mixed $name The permission name / label. |
||
85 | * @return self |
||
86 | */ |
||
87 | public function setName($name) |
||
92 | |||
93 | /** |
||
94 | * @return \Charcoal\Translator\Translation|null |
||
95 | */ |
||
96 | public function getName() |
||
97 | { |
||
98 | return $this->name; |
||
99 | } |
||
100 | |||
101 | /** |
||
102 | * @param Container $container Pimple DI container. |
||
103 | * @return void |
||
104 | */ |
||
105 | protected function setDependencies(Container $container) |
||
110 | } |
||
111 |