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

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