glpi / src / Vigilo / VigiloGroups.php @ e809466b
History | View | Annotate | Download (594 Bytes)
1 | a5c9df40 | Thibault Louet | <?php
|
---|---|---|---|
2 | |||
3 | class VigiloGroups extends VigiloXml |
||
4 | { |
||
5 | protected $name; |
||
6 | ad6689da | Francois POIROTTE | protected $groups; |
7 | a5c9df40 | Thibault Louet | |
8 | public function __construct($name) |
||
9 | { |
||
10 | ad6689da | Francois POIROTTE | $this->name = $name; |
11 | $this->groups = array(); |
||
12 | a5c9df40 | Thibault Louet | } |
13 | |||
14 | public function getName() |
||
15 | { |
||
16 | return $this->name; |
||
17 | } |
||
18 | |||
19 | public function addSubGroup(VigiloGroups $subGroup) |
||
20 | { |
||
21 | ad6689da | Francois POIROTTE | $this->groups[$subGroup->getName()] = $subGroup; |
22 | a5c9df40 | Thibault Louet | } |
23 | |||
24 | public function __toString() |
||
25 | { |
||
26 | return self::sprintf( |
||
27 | '<group name="%s">%s</group>',
|
||
28 | $this->name,
|
||
29 | ad6689da | Francois POIROTTE | $this->groups
|
30 | a5c9df40 | Thibault Louet | ); |
31 | } |
||
32 | } |