![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mautic.corals.io/vendor/litesaml/lightsaml/src/Model/Assertion/ |
<?php namespace LightSaml\Model\Assertion; use LightSaml\Model\Context\DeserializationContext; use LightSaml\Model\Context\SerializationContext; use LightSaml\SamlConstants; class AttributeStatement extends AbstractStatement { /** * @var Attribute[] */ protected $attributes = []; /** * @return AttributeStatement */ public function addAttribute(Attribute $attribute) { $this->attributes[] = $attribute; return $this; } /** * @return \LightSaml\Model\Assertion\Attribute[] */ public function getAllAttributes() { return $this->attributes; } /** * @param string $name * * @return Attribute|null */ public function getFirstAttributeByName($name) { if (is_array($this->getAllAttributes())) { foreach ($this->getAllAttributes() as $attribute) { if (null == $name || $attribute->getName() == $name) { return $attribute; } } } return null; } /** * @return void */ public function serialize(\DOMNode $parent, SerializationContext $context) { $result = $this->createElement('AttributeStatement', SamlConstants::NS_ASSERTION, $parent, $context); $this->manyElementsToXml($this->getAllAttributes(), $result, $context, null); } public function deserialize(\DOMNode $node, DeserializationContext $context) { $this->checkXmlNodeName($node, 'AttributeStatement', SamlConstants::NS_ASSERTION); $this->attributes = []; $this->manyElementsFromXml( $node, $context, 'Attribute', 'saml', 'LightSaml\Model\Assertion\Attribute', 'addAttribute' ); } }