1717
1818abstract class BaseIDType
1919{
20- /**
21- * The security or administrative domain that qualifies the identifier.
22- * This attribute provides a means to federate identifiers from disparate user stores without collision.
23- *
24- * @see saml-core-2.0-os
25- *
26- * @var string|null
27- */
28- protected $ NameQualifier = null ;
20+ use IDNameQualifiersTrait;
2921
30- /**
31- * Further qualifies an identifier with the name of a service provider or affiliation of providers.
32- * This attribute provides an additional means to federate identifiers on the basis of the relying party or parties.
33- *
34- * @see saml-core-2.0-os
35- *
36- * @var string|null
37- */
38- protected $ SPNameQualifier = null ;
3922
4023 /**
4124 * The name for this BaseID.
@@ -68,52 +51,6 @@ public function __construct(DOMElement $xml = null)
6851 }
6952
7053
71- /**
72- * Collect the value of the NameQualifier-property
73- *
74- * @return string|null
75- */
76- public function getNameQualifier () : ?string
77- {
78- return $ this ->NameQualifier ;
79- }
80-
81-
82- /**
83- * Set the value of the NameQualifier-property
84- *
85- * @param string|null $nameQualifier
86- * @return void
87- */
88- public function setNameQualifier (string $ nameQualifier = null ) : void
89- {
90- $ this ->NameQualifier = $ nameQualifier ;
91- }
92-
93-
94- /**
95- * Collect the value of the SPNameQualifier-property
96- *
97- * @return string|null
98- */
99- public function getSPNameQualifier () : ?string
100- {
101- return $ this ->SPNameQualifier ;
102- }
103-
104-
105- /**
106- * Set the value of the SPNameQualifier-property
107- *
108- * @param string|null $spNameQualifier
109- * @return void
110- */
111- public function setSPNameQualifier (string $ spNameQualifier = null ) : void
112- {
113- $ this ->SPNameQualifier = $ spNameQualifier ;
114- }
115-
116-
11754 /**
11855 * Convert this BaseID to XML.
11956 *
@@ -132,28 +69,13 @@ public function toXML(DOMElement $parent = null) : DOMElement
13269 $ parent ->appendChild ($ element );
13370
13471 if ($ this ->NameQualifier !== null ) {
135- $ element ->setAttribute ('NameQualifier ' , $ this ->NameQualifier );
72+ $ element ->setAttribute ('NameQualifier ' , $ this ->getNameQualifier () );
13673 }
13774
13875 if ($ this ->SPNameQualifier !== null ) {
139- $ element ->setAttribute ('SPNameQualifier ' , $ this ->SPNameQualifier );
76+ $ element ->setAttribute ('SPNameQualifier ' , $ this ->getSPNameQualifier () );
14077 }
14178
14279 return $ element ;
14380 }
144-
145-
146- /**
147- * Get a string representation of this BaseIDType object.
148- *
149- * @return string The resulting XML, as a string.
150- */
151- public function __toString ()
152- {
153- $ doc = DOMDocumentFactory::create ();
154- $ root = $ doc ->createElementNS (Constants::NS_SAML , 'root ' );
155- $ ele = $ this ->toXML ($ root );
156-
157- return $ doc ->saveXML ($ ele );
158- }
15981}
0 commit comments