Zend_Ldap-API-Ldap-Node-Schema.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect3 id="zend.ldap.api.reference.zend-ldap-node-schema">
  4. <title>Zend_Ldap_Node_Schema</title>
  5. <para>The following methods are available on all vendor-specific subclasses.</para>
  6. <para>
  7. <code>Zend_Ldap_Node_Schema</code> includes the magic property accessors
  8. <code>__get()</code> and <code>__isset()</code> to access the attributes by their
  9. name. They proxy to <code>Zend_Ldap_Node_Schema::getAttribute()</code> and
  10. <code>Zend_Ldap_Node_Schema::existsAttribute()</code> respectively.
  11. <code>__set()</code> and <code>__unset()</code> are also implemented, but they throw
  12. a <code>BadMethodCallException</code> as modifications are not allowed on RootDSE
  13. nodes. Furthermore the class implements <code>ArrayAccess</code> for
  14. array-style-access to the attributes. <code>offsetSet()</code> and
  15. <code>offsetUnset()</code> also throw a <code>BadMethodCallException</code> due to
  16. obvious reasons.
  17. </para>
  18. <table id="zend.ldap.api.reference.zend-ldap-node-schema.table">
  19. <title>Zend_Ldap_Node_Schema API</title>
  20. <tgroup cols="2">
  21. <thead>
  22. <row>
  23. <entry>Method</entry>
  24. <entry>Description</entry>
  25. </row>
  26. </thead>
  27. <tbody>
  28. <row>
  29. <entry><code>Zend_Ldap_Dn getDn()</code></entry>
  30. <entry>
  31. Gets the DN of the current node as a <classname>Zend_Ldap_Dn</classname>.
  32. </entry>
  33. </row>
  34. <row>
  35. <entry><code>string getDnString(string $caseFold)</code></entry>
  36. <entry>Gets the DN of the current node as a string.</entry>
  37. </row>
  38. <row>
  39. <entry><code>array getDnArray(string $caseFold)</code></entry>
  40. <entry>Gets the DN of the current node as an array.</entry>
  41. </row>
  42. <row>
  43. <entry><code>string getRdnString(string $caseFold)</code></entry>
  44. <entry>Gets the <acronym>RDN</acronym> of the current node as a string.</entry>
  45. </row>
  46. <row>
  47. <entry><code>array getRdnArray(string $caseFold)</code></entry>
  48. <entry>Gets the <acronym>RDN</acronym> of the current node as an array.</entry>
  49. </row>
  50. <row>
  51. <entry><code>array getObjectClass()</code></entry>
  52. <entry>Returns the objectClass of the node.</entry>
  53. </row>
  54. <row>
  55. <entry><code>string toString()</code></entry>
  56. <entry>
  57. Returns the DN of the current node - proxies to
  58. <code>Zend_Ldap_Dn::getDnString()</code>.
  59. </entry>
  60. </row>
  61. <row>
  62. <entry><code>string __toString()</code></entry>
  63. <entry>
  64. Casts to string representation - proxies to
  65. <code>Zend_Ldap_Dn::toString()</code>.
  66. </entry>
  67. </row>
  68. <row>
  69. <entry><code>array toArray(boolean $includeSystemAttributes)</code></entry>
  70. <entry>
  71. Returns an array representation of the current node. If
  72. <code>$includeSystemAttributes</code> is <constant>FALSE</constant>
  73. (defaults to <constant>TRUE</constant>), the system specific attributes are
  74. stripped from the array. Unlike
  75. <code>Zend_Ldap_Node_Schema::getAttributes()</code>, the resulting
  76. array contains the DN with key <code>'dn'</code>.
  77. </entry>
  78. </row>
  79. <row>
  80. <entry><code>string toJson(boolean $includeSystemAttributes)</code></entry>
  81. <entry>
  82. Returns a <acronym>JSON</acronym> representation of the current node using
  83. <code>Zend_Ldap_Node_Schema::toArray()</code>.
  84. </entry>
  85. </row>
  86. <row>
  87. <entry><code>array getData(boolean $includeSystemAttributes)</code></entry>
  88. <entry>
  89. Returns the node's attributes. The array contains all
  90. attributes in its internal format (no conversion).
  91. </entry>
  92. </row>
  93. <row>
  94. <entry>
  95. <code>boolean existsAttribute(string $name, boolean $emptyExists)</code>
  96. </entry>
  97. <entry>
  98. Checks whether a given attribute exists. If
  99. <code>$emptyExists</code> is <constant>FALSE</constant>, empty attributes
  100. (containing only array()) are treated as non-existent returning
  101. <constant>FALSE</constant>. If <code>$emptyExists</code> is
  102. <constant>TRUE</constant>, empty attributes are treated as existent
  103. returning <constant>TRUE</constant>. In this case the method returns
  104. <constant>FALSE</constant> only if the attribute name is missing in the
  105. key-collection.
  106. </entry>
  107. </row>
  108. <row>
  109. <entry>
  110. <code>boolean attributeHasValue(string $name, mixed|array $value)</code>
  111. </entry>
  112. <entry>
  113. Checks if the given value(s) exist in the attribute. The
  114. method returns <constant>TRUE</constant> only if all values in
  115. <code>$value</code> are present in the attribute. Comparison is
  116. done strictly (respecting the data type).
  117. </entry>
  118. </row>
  119. <row>
  120. <entry><code>integer count()</code></entry>
  121. <entry>
  122. Returns the number of attributes in the node. Implements Countable.
  123. </entry>
  124. </row>
  125. <row>
  126. <entry>
  127. <code>mixed getAttribute(string $name, integer|null $index)</code>
  128. </entry>
  129. <entry>
  130. Gets a <acronym>LDAP</acronym> attribute. Data conversion is applied using
  131. <code>Zend_Ldap_Attribute::getAttribute()</code>.
  132. </entry>
  133. </row>
  134. <row>
  135. <entry>
  136. <code>array getAttributes(boolean $includeSystemAttributes)</code>
  137. </entry>
  138. <entry>
  139. Gets all attributes of node. If
  140. <code>$includeSystemAttributes</code> is <constant>FALSE</constant>
  141. (defaults to <constant>TRUE</constant>) the system specific attributes are
  142. stripped from the array.
  143. </entry>
  144. </row>
  145. <row>
  146. <entry>
  147. <code>array|integer getDateTimeAttribute(string $name,
  148. integer|null $index)</code>
  149. </entry>
  150. <entry>
  151. Gets a <acronym>LDAP</acronym> date/time attribute. Data conversion is
  152. applied using <code>Zend_Ldap_Attribute::getDateTimeAttribute()</code>.
  153. </entry>
  154. </row>
  155. <row>
  156. <entry>
  157. <code>Zend_Ldap_Node_Schema reload(Zend_Ldap $ldap)</code>
  158. </entry>
  159. <entry>
  160. Reloads the current node's attributes from the given <acronym>LDAP</acronym>
  161. server.
  162. </entry>
  163. </row>
  164. <row>
  165. <entry>
  166. <emphasis><code>Zend_Ldap_Node_Schema create(Zend_Ldap
  167. $ldap)</code> </emphasis>
  168. </entry>
  169. <entry>Factory method to create the Schema node.</entry>
  170. </row>
  171. <row>
  172. <entry><code>array getAttributeTypes()</code></entry>
  173. <entry>Gets the attribute types as an array of <code/>.</entry>
  174. </row>
  175. <row>
  176. <entry><code>array getObjectClasses()</code></entry>
  177. <entry>
  178. Gets the object classes as an array of
  179. <code>Zend_Ldap_Node_Schema_ObjectClass_Interface</code>.
  180. </entry>
  181. </row>
  182. </tbody>
  183. </tgroup>
  184. </table>
  185. <table id="zend.ldap.api.reference.zend-ldap-node-schema.attributetype-interface.table">
  186. <title>Zend_Ldap_Node_Schema_AttributeType_Interface API</title>
  187. <tgroup cols="2">
  188. <thead>
  189. <row>
  190. <entry>Method</entry>
  191. <entry>Description</entry>
  192. </row>
  193. </thead>
  194. <tbody>
  195. <row>
  196. <entry><code>string getName()</code></entry>
  197. <entry>Gets the attribute name.</entry>
  198. </row>
  199. <row>
  200. <entry><code>string getOid()</code></entry>
  201. <entry>Gets the attribute <acronym>OID</acronym>.</entry>
  202. </row>
  203. <row>
  204. <entry><code>string getSyntax()</code></entry>
  205. <entry>Gets the attribute syntax.</entry>
  206. </row>
  207. <row>
  208. <entry><code>int|null getMaxLength()</code></entry>
  209. <entry>Gets the attribute maximum length.</entry>
  210. </row>
  211. <row>
  212. <entry><code>boolean isSingleValued()</code></entry>
  213. <entry>Returns if the attribute is single-valued.</entry>
  214. </row>
  215. <row>
  216. <entry><code>string getDescription()</code></entry>
  217. <entry>Gets the attribute description</entry>
  218. </row>
  219. </tbody>
  220. </tgroup>
  221. </table>
  222. <table id="zend.ldap.api.reference.zend-ldap-node-schema.objectclass-interface.table">
  223. <title>Zend_Ldap_Node_Schema_ObjectClass_Interface API</title>
  224. <tgroup cols="2">
  225. <thead>
  226. <row>
  227. <entry>Method</entry>
  228. <entry>Description</entry>
  229. </row>
  230. </thead>
  231. <tbody>
  232. <row>
  233. <entry><code>string getName()</code></entry>
  234. <entry>Returns the objectClass name.</entry>
  235. </row>
  236. <row>
  237. <entry><code>string getOid()</code></entry>
  238. <entry>Returns the objectClass <acronym>OID</acronym>.</entry>
  239. </row>
  240. <row>
  241. <entry><code>array getMustContain()</code></entry>
  242. <entry>Returns the attributes that this objectClass must contain.</entry>
  243. </row>
  244. <row>
  245. <entry><code>array getMayContain()</code></entry>
  246. <entry>Returns the attributes that this objectClass may contain.</entry>
  247. </row>
  248. <row>
  249. <entry><code>string getDescription()</code></entry>
  250. <entry>Returns the attribute description</entry>
  251. </row>
  252. <row>
  253. <entry><code>integer getType()</code></entry>
  254. <entry>
  255. Returns the objectClass type. The method returns one of the following
  256. values:
  257. <variablelist>
  258. <varlistentry>
  259. <term><code>Zend_Ldap_Node_Schema::OBJECTCLASS_TYPE_UNKNOWN</code></term>
  260. <listitem><para>for unknown class types</para></listitem>
  261. </varlistentry>
  262. <varlistentry>
  263. <term><code>Zend_Ldap_Node_Schema::OBJECTCLASS_TYPE_STRUCTURAL</code></term>
  264. <listitem><para>for structural classes</para></listitem>
  265. </varlistentry>
  266. <varlistentry>
  267. <term><code>Zend_Ldap_Node_Schema::OBJECTCLASS_TYPE_ABSTRACT</code></term>
  268. <listitem><para>for abstract classes</para></listitem>
  269. </varlistentry>
  270. <varlistentry>
  271. <term><code>Zend_Ldap_Node_Schema::OBJECTCLASS_TYPE_AUXILIARY</code></term>
  272. <listitem><para>for auxiliary classes</para></listitem>
  273. </varlistentry>
  274. </variablelist>
  275. </entry>
  276. </row>
  277. <row>
  278. <entry><code>array getParentClasses()</code></entry>
  279. <entry>
  280. Returns the parent objectClasses of this class. This
  281. includes structural, abstract and auxiliary objectClasses.
  282. </entry>
  283. </row>
  284. </tbody>
  285. </tgroup>
  286. </table>
  287. <para>
  288. Classes representing attribute types and object classes extend
  289. <code>Zend_Ldap_Node_Schema_Item</code> which provides some core methods to access
  290. arbitrary attributes on the underlying <acronym>LDAP</acronym> node.
  291. <code>Zend_Ldap_Node_Schema_Item</code> includes the magic property accessors
  292. <code>__get()</code> and <code>__isset()</code> to access the attributes by their
  293. name. Furthermore the class implements <code>ArrayAccess</code> for
  294. array-style-access to the attributes. <code>offsetSet()</code> and
  295. <code>offsetUnset()</code> throw a <code>BadMethodCallException</code> as
  296. modifications are not allowed on schema information nodes.
  297. </para>
  298. <table id="zend.ldap.api.reference.zend-ldap-node-schema.schema-item.table">
  299. <title>Zend_Ldap_Node_Schema_Item API</title>
  300. <tgroup cols="2">
  301. <thead>
  302. <row>
  303. <entry>Method</entry>
  304. <entry>Description</entry>
  305. </row>
  306. </thead>
  307. <tbody>
  308. <row>
  309. <entry><code>array getData()</code></entry>
  310. <entry>Gets all the underlying data from the schema information node.</entry>
  311. </row>
  312. <row>
  313. <entry><code>integer count()</code></entry>
  314. <entry>
  315. Returns the number of attributes in this schema information
  316. node. Implements Countable.
  317. </entry>
  318. </row>
  319. </tbody>
  320. </tgroup>
  321. </table>
  322. <sect4 id="zend.ldap.api.reference.zend-ldap-node-schema.openldap">
  323. <title>OpenLDAP</title>
  324. <para>
  325. Additionally the common methods above apply to instances of
  326. <code>Zend_Ldap_Node_Schema_OpenLDAP</code>.
  327. </para>
  328. <table id="zend.ldap.api.reference.zend-ldap-node-schema.openldap.table">
  329. <title>Zend_Ldap_Node_Schema_OpenLDAP API</title>
  330. <tgroup cols="2">
  331. <thead>
  332. <row>
  333. <entry>Method</entry>
  334. <entry>Description</entry>
  335. </row>
  336. </thead>
  337. <tbody>
  338. <row>
  339. <entry><code>array getLdapSyntaxes()</code></entry>
  340. <entry>Gets the <acronym>LDAP</acronym> syntaxes.</entry>
  341. </row>
  342. <row>
  343. <entry><code>array getMatchingRules()</code></entry>
  344. <entry>Gets the matching rules.</entry>
  345. </row>
  346. <row>
  347. <entry><code>array getMatchingRuleUse()</code></entry>
  348. <entry>Gets the matching rule use.</entry>
  349. </row>
  350. </tbody>
  351. </tgroup>
  352. </table>
  353. <table
  354. id="zend.ldap.api.reference.zend-ldap-node-schema.openldap.attributetype-interface.table">
  355. <title>Zend_Ldap_Node_Schema_AttributeType_OpenLDAP API</title>
  356. <tgroup cols="2">
  357. <thead>
  358. <row>
  359. <entry>Method</entry>
  360. <entry>Description</entry>
  361. </row>
  362. </thead>
  363. <tbody>
  364. <row>
  365. <entry>
  366. <code>Zend_Ldap_Node_Schema_AttributeType_OpenLdap|null
  367. getParent()</code>
  368. </entry>
  369. <entry>
  370. Returns the parent attribute type in the inheritance tree if one exists.
  371. </entry>
  372. </row>
  373. </tbody>
  374. </tgroup>
  375. </table>
  376. <table
  377. id="zend.ldap.api.reference.zend-ldap-node-schema.openldap.objectclass-interface.table">
  378. <title>Zend_Ldap_Node_Schema_ObjectClass_OpenLDAP API</title>
  379. <tgroup cols="2">
  380. <thead>
  381. <row>
  382. <entry>Method</entry>
  383. <entry>Description</entry>
  384. </row>
  385. </thead>
  386. <tbody>
  387. <row>
  388. <entry><code>array getParents()</code></entry>
  389. <entry>
  390. Returns the parent object classes in the inheritance
  391. tree if one exists. The returned array is an array of
  392. <code>Zend_Ldap_Node_Schema_ObjectClass_OpenLdap</code>.
  393. </entry>
  394. </row>
  395. </tbody>
  396. </tgroup>
  397. </table>
  398. </sect4>
  399. <sect4 id="zend.ldap.api.reference.zend-ldap-node-schema.activedirectory">
  400. <title>ActiveDirectory</title>
  401. <note>
  402. <title>Schema browsing on ActiveDirectory servers</title>
  403. <para>
  404. Due to restrictions on Microsoft ActiveDirectory servers regarding
  405. the number of entries returned by generic search routines and due to the
  406. structure of the ActiveDirectory schema repository, schema browsing is
  407. currently <emphasis>not</emphasis> available for Microsoft ActiveDirectory
  408. servers.
  409. </para>
  410. </note>
  411. <para>
  412. <code>Zend_Ldap_Node_Schema_ActiveDirectory</code> does not provide any
  413. additional methods.
  414. </para>
  415. <table
  416. id="zend.ldap.api.reference.zend-ldap-node-schema.activedirectory.attributetype-interface.table">
  417. <title>Zend_Ldap_Node_Schema_AttributeType_ActiveDirectory API</title>
  418. <tgroup cols="1">
  419. <tbody>
  420. <row>
  421. <entry>
  422. <code>Zend_Ldap_Node_Schema_AttributeType_ActiveDirectory</code>
  423. does not provide any additional methods.
  424. </entry>
  425. </row>
  426. </tbody>
  427. </tgroup>
  428. </table>
  429. <table
  430. id="zend.ldap.api.reference.zend-ldap-node-schema.activedirectory.objectclass-interface.table">
  431. <title>Zend_Ldap_Node_Schema_ObjectClass_ActiveDirectory API</title>
  432. <tgroup cols="1">
  433. <tbody>
  434. <row>
  435. <entry>
  436. <code>Zend_Ldap_Node_Schema_ObjectClass_ActiveDirectory</code>
  437. does not provide any additional methods.
  438. </entry>
  439. </row>
  440. </tbody>
  441. </tgroup>
  442. </table>
  443. </sect4>
  444. </sect3>