1<?php
2
3namespace FINDOLOGIC\Export\Data;
4
5use FINDOLOGIC\Export\Helpers\Serializable;
6use FINDOLOGIC\Export\Helpers\XMLHelper;
7
8class Usergroup implements Serializable
9{
10    /** @var string */
11    private $value;
12
13    public function __construct($value)
14    {
15        $this->value = $value;
16    }
17
18    public function getValue()
19    {
20        return $this->value;
21    }
22
23    /**
24     * @SuppressWarnings(PHPMD.StaticAccess)
25     * @inheritdoc
26     */
27    public function getDomSubtree(\DOMDocument $document)
28    {
29        $usergroupElem = XMLHelper::createElementWithText($document, 'usergroup', $this->value);
30
31        return $usergroupElem;
32    }
33
34    /**
35     * No-op, because usergroups are not supported in the CSV export format.
36     */
37    public function getCsvFragment()
38    {
39        return '';
40    }
41
42    public function __toString()
43    {
44        return $this->value;
45    }
46}
47