/** * Initialize an IndexedEndpointType. * * @param \DOMElement|null $xml The XML element we should load. * @throws \Exception */ public function __construct(\DOMElement $xml = null) { parent::__construct($xml); if ($xml === null) { return; } if (!$xml->hasAttribute('index')) { throw new \Exception('Missing index on ' . $xml->tagName); } $this->index = (int) $xml->getAttribute('index'); $this->isDefault = Utils::parseBoolean($xml, 'isDefault', null); }