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

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