Zend_Ldap-API-Ldap-Node.xml 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- EN-Revision: 17230 -->
  3. <!-- Reviewed: no -->
  4. <sect3 id="zend.ldap.api.reference.zend-ldap-node">
  5. <title>Zend_Ldap_Node</title>
  6. <para>
  7. <classname>Zend_Ldap_Node</classname> includes the magic propery accessors
  8. <methodname>__set()</methodname>, <methodname>__get()</methodname>,
  9. <methodname>__unset()</methodname> and <methodname>__isset()</methodname> to access the
  10. attributes by their name. They proxy to
  11. <methodname>Zend_Ldap_Node::setAttribute()</methodname>,
  12. <methodname>Zend_Ldap_Node::getAttribute()</methodname>,
  13. <methodname>Zend_Ldap_Node::deleteAttribute()</methodname> and
  14. <methodname>Zend_Ldap_Node::existsAttribute()</methodname> respectively. Furthermore the
  15. class implements <code>ArrayAccess</code> for array-style-access to the attributes.
  16. <classname>Zend_Ldap_Node</classname> also implements <code>Iterator</code> and
  17. <code>RecursiveIterato</code> to allow for recursive tree-traversal.
  18. </para>
  19. <table id="zend.ldap.api.reference.zend-ldap-node.table">
  20. <title>Zend_Ldap_Node 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 getLdap()</code></entry>
  31. <entry>
  32. Returns the current <acronym>LDAP</acronym> connection. Throws
  33. <classname>Zend_Ldap_Exception</classname> if current node is in detached
  34. mode (not connected to a <classname>Zend_Ldap</classname> instance).
  35. </entry>
  36. </row>
  37. <row>
  38. <entry>
  39. <code>Zend_Ldap_Node attachLdap(Zend_Ldap
  40. $ldap)</code>
  41. </entry>
  42. <entry>
  43. Attach the current node to the <varname>$ldap</varname>
  44. <classname>Zend_Ldap</classname> instance. Throws
  45. <classname>Zend_Ldap_Exception</classname> if <varname>$ldap</varname> is
  46. not responsible for the current node (node is not a child of the
  47. <varname>$ldap</varname> base DN).
  48. </entry>
  49. </row>
  50. <row>
  51. <entry><code>Zend_Ldap_Node detachLdap()</code></entry>
  52. <entry>Detach node from <acronym>LDAP</acronym> connection.</entry>
  53. </row>
  54. <row>
  55. <entry><code>boolean isAttached()</code></entry>
  56. <entry>
  57. Checks if the current node is attached to a <acronym>LDAP</acronym>
  58. connection.
  59. </entry>
  60. </row>
  61. <row>
  62. <entry>
  63. <emphasis><code>Zend_Ldap_Node
  64. create(string|array|Zend_Ldap_Dn $dn, array $objectClass)</code>
  65. </emphasis>
  66. </entry>
  67. <entry>
  68. Factory method to create a new detached
  69. <classname>Zend_Ldap_Node</classname> for a given DN. Creates a new
  70. <classname>Zend_Ldap_Node</classname> with the DN <varname>$dn</varname> and
  71. the object-classes <varname>$objectClass</varname>.
  72. </entry>
  73. </row>
  74. <row>
  75. <entry>
  76. <emphasis><code>Zend_Ldap_Node
  77. fromLdap(string|array|Zend_Ldap_Dn $dn, Zend_Ldap $ldap)</code>
  78. </emphasis>
  79. </entry>
  80. <entry>
  81. Factory method to create an attached
  82. <classname>Zend_Ldap_Node</classname> for a given DN. Loads an existing
  83. <classname>Zend_Ldap_Node</classname> with the DN <varname>$dn</varname>
  84. from the <acronym>LDAP</acronym> connection <varname>$ldap</varname>.
  85. </entry>
  86. </row>
  87. <row>
  88. <entry>
  89. <emphasis><code>Zend_Ldap_Node fromArray((array $data,
  90. boolean $fromDataSource)</code> </emphasis>
  91. </entry>
  92. <entry>
  93. Factory method to create a detached
  94. <classname>Zend_Ldap_Node</classname> from array data
  95. <varname>$data</varname>. if <varname>$fromDataSource</varname> is
  96. <constant>TRUE</constant> (<constant>FALSE</constant> by default), the data is treated as
  97. beeing present in a <acronym>LDAP</acronym> tree.
  98. </entry>
  99. </row>
  100. <row>
  101. <entry><code>boolean isNew()</code></entry>
  102. <entry>
  103. Tells if the node is consiedered as new (not present on the
  104. server). Please note, that this doesn't tell if the node is really
  105. present on the server. Use <methodname>Zend_Ldap_Node::exists()</methodname>
  106. to see if a node is already there.
  107. </entry>
  108. </row>
  109. <row>
  110. <entry><code>boolean willBeDeleted()</code></entry>
  111. <entry>
  112. Tells if this node is going to be deleted once
  113. <methodname>Zend_Ldap_Node::update()</methodname> is called.
  114. </entry>
  115. </row>
  116. <row>
  117. <entry><code>Zend_Ldap_Node delete()</code></entry>
  118. <entry>
  119. Marks this node as to be deleted. Node will be deleted on
  120. calling <methodname>Zend_Ldap_Node::update()</methodname> if
  121. <methodname>Zend_Ldap_Node::willBeDeleted()</methodname> is true.
  122. </entry>
  123. </row>
  124. <row>
  125. <entry><code>boolean willBeMoved()</code></entry>
  126. <entry>
  127. Tells if this node is going to be moved once
  128. <methodname>Zend_Ldap_Node::update()</methodname> is called.
  129. </entry>
  130. </row>
  131. <row>
  132. <entry><code>Zend_Ldap_Node update(Zend_Ldap $ldap)</code></entry>
  133. <entry>
  134. Sends all pending changes to the <acronym>LDAP</acronym> server. If
  135. <varname>$ldap</varname> is omitted the current <acronym>LDAP</acronym>
  136. connection is used. If the current node is detached from a
  137. <acronym>LDAP</acronym> connection a
  138. <classname>Zend_Ldap_Exception</classname> will be thrown. If
  139. <varname>$ldap</varname> is provided the current node will be attached to
  140. the given <acronym>LDAP</acronym> connection.
  141. </entry>
  142. </row>
  143. <row>
  144. <entry><code>Zend_Ldap_Dn getCurrentDn()</code></entry>
  145. <entry>
  146. Gets the current DN of the current node as a Zend_Ldap_Dn.
  147. This does not reflect possible rename-operations.
  148. </entry>
  149. </row>
  150. <row>
  151. <entry><code>Zend_Ldap_Dn getDn()</code></entry>
  152. <entry>
  153. Gets the original DN of the current node as a Zend_Ldap_Dn.
  154. This reflects possible rename-operations.
  155. </entry>
  156. </row>
  157. <row>
  158. <entry><code>string getDnString(string $caseFold)</code></entry>
  159. <entry>
  160. Gets the original DN of the current node as a string. This
  161. reflects possible rename-operations.
  162. </entry>
  163. </row>
  164. <row>
  165. <entry><code>array getDnArray(string $caseFold)</code></entry>
  166. <entry>
  167. Gets the original DN of the current node as an array. This
  168. reflects possible rename-operations.
  169. </entry>
  170. </row>
  171. <row>
  172. <entry><code>string getRdnString(string $caseFold)</code></entry>
  173. <entry>
  174. Gets the <acronym>RDN</acronym> of the current node as a string. This
  175. reflects possible rename-operations.
  176. </entry>
  177. </row>
  178. <row>
  179. <entry><code>array getRdnArray(string $caseFold)</code></entry>
  180. <entry>
  181. Gets the <acronym>RDN</acronym> of the current node as an array. This
  182. reflects possible rename-operations.
  183. </entry>
  184. </row>
  185. <row>
  186. <entry>
  187. <code>Zend_Ldap_Node setDn(Zend_Ldap_Dn|string|array
  188. $newDn)</code>
  189. </entry>
  190. <entry>
  191. Sets the new DN for this node effectively moving the node
  192. once <methodname>Zend_Ldap_Node::update()</methodname> is called.
  193. </entry>
  194. </row>
  195. <row>
  196. <entry>
  197. <code>Zend_Ldap_Node move(Zend_Ldap_Dn|string|array
  198. $newDn)</code>
  199. </entry>
  200. <entry>
  201. This is an alias for
  202. <methodname>Zend_Ldap_Node::setDn()</methodname>.
  203. </entry>
  204. </row>
  205. <row>
  206. <entry>
  207. <code>Zend_Ldap_Node rename(Zend_Ldap_Dn|string|array
  208. $newDn)</code>
  209. </entry>
  210. <entry>
  211. This is an alias for
  212. <methodname>Zend_Ldap_Node::setDn()</methodname>.
  213. </entry>
  214. </row>
  215. <row>
  216. <entry><code>array getObjectClass()</code></entry>
  217. <entry>Returns the objectClass of the node.</entry>
  218. </row>
  219. <row>
  220. <entry>
  221. <code>Zend_Ldap_Node setObjectClass(array|string
  222. $value)</code>
  223. </entry>
  224. <entry>Sets the objectClass attribute.</entry>
  225. </row>
  226. <row>
  227. <entry>
  228. <code>Zend_Ldap_Node appendObjectClass(array|string
  229. $value)</code>
  230. </entry>
  231. <entry>Appends to the objectClass attribute.</entry>
  232. </row>
  233. <row>
  234. <entry><code>string toLdif(array $options)</code></entry>
  235. <entry>
  236. Returns a <acronym>LDIF</acronym> representation of the current node.
  237. <varname>$options</varname> will be passed to the
  238. <classname>Zend_Ldap_Ldif_Encoder</classname>.
  239. </entry>
  240. </row>
  241. <row>
  242. <entry><code>array getChangedData()</code></entry>
  243. <entry>
  244. Gets changed node data. The array contains all changed
  245. attributes. This format can be used in
  246. <methodname>Zend_Ldap::add()</methodname> and
  247. <methodname>Zend_Ldap::update()</methodname>.
  248. </entry>
  249. </row>
  250. <row>
  251. <entry><code>array getChanges()</code></entry>
  252. <entry>Returns all changes made.</entry>
  253. </row>
  254. <row>
  255. <entry><code>string toString()</code></entry>
  256. <entry>
  257. Returns the DN of the current node - proxies to
  258. <methodname>Zend_Ldap_Dn::getDnString()</methodname>.
  259. </entry>
  260. </row>
  261. <row>
  262. <entry><code>string __toString()</code></entry>
  263. <entry>
  264. Casts to string representation - proxies to
  265. <methodname>Zend_Ldap_Dn::toString()</methodname>.
  266. </entry>
  267. </row>
  268. <row>
  269. <entry>
  270. <code>array toArray(boolean
  271. $includeSystemAttributes)</code>
  272. </entry>
  273. <entry>
  274. Returns an array representation of the current node. If
  275. <varname>$includeSystemAttributes</varname> is <constant>FALSE</constant>
  276. (defaults to <constant>TRUE</constant>) the system specific attributes are
  277. stripped from the array. Unlike
  278. <methodname>Zend_Ldap_Node::getAttributes()</methodname> the resulting array
  279. contains the DN with key <code>'dn'</code>.
  280. </entry>
  281. </row>
  282. <row>
  283. <entry>
  284. <code>string toJson(boolean
  285. $includeSystemAttributes)</code>
  286. </entry>
  287. <entry>
  288. Returns a <acronym>JSON</acronym> representation of the current node using
  289. <methodname>Zend_Ldap_Node::toArray()</methodname>.
  290. </entry>
  291. </row>
  292. <row>
  293. <entry>
  294. <code>array getData(boolean
  295. $includeSystemAttributes)</code>
  296. </entry>
  297. <entry>
  298. Returns the node's attributes. The array contains all
  299. attributes in its internal format (no conversion).
  300. </entry>
  301. </row>
  302. <row>
  303. <entry>
  304. <code>boolean existsAttribute(string $name, boolean
  305. $emptyExists)</code>
  306. </entry>
  307. <entry>
  308. Checks whether a given attribute exists. If
  309. <varname>$emptyExists</varname> is <constant>FALSE</constant> empty attributes
  310. (containing only array()) are treated as non-existent returning
  311. <constant>FALSE</constant>. If <varname>$emptyExists</varname> is true empty
  312. attributes are treated as existent returning <constant>TRUE</constant>. In
  313. this case teh method returns <constant>FALSE</constant> only if the
  314. attribute name is missing in the key-collection.
  315. </entry>
  316. </row>
  317. <row>
  318. <entry>
  319. <code>boolean attributeHasValue(string $name, mixed|array
  320. $value)</code>
  321. </entry>
  322. <entry>
  323. Checks if the given value(s) exist in the attribute. The
  324. method returns <constant>TRUE</constant> only if all values in
  325. <varname>$value</varname> are present in the attribute. Comparison is
  326. done strictly (respecting the data type).
  327. </entry>
  328. </row>
  329. <row>
  330. <entry><code>integer count()</code></entry>
  331. <entry>
  332. Returns the number of attributes in the node. Implements
  333. Countable.
  334. </entry>
  335. </row>
  336. <row>
  337. <entry>
  338. <code>mixed getAttribute(string $name, integer|null
  339. $index)</code>
  340. </entry>
  341. <entry>
  342. Gets a <acronym>LDAP</acronym> attribute. Data conversion is applied using
  343. <methodname>Zend_Ldap_Attribute::getAttribute()</methodname>.
  344. </entry>
  345. </row>
  346. <row>
  347. <entry>
  348. <code>array getAttributes(boolean
  349. $includeSystemAttributes)</code>
  350. </entry>
  351. <entry>
  352. Gets all attributes of node. If
  353. <varname>$includeSystemAttributes</varname> is <constant>FALSE</constant>
  354. (defaults to <constant>TRUE</constant>) the system specific attributes are
  355. stripped from the array.
  356. </entry>
  357. </row>
  358. <row>
  359. <entry>
  360. <code>Zend_Ldap_Node setAttribute(string $name, mixed
  361. $value)</code>
  362. </entry>
  363. <entry>
  364. Setzt ein <acronym>LDAP</acronym> Attribut. Die Datenkonvertierung wird
  365. angewendet durch Verwendung von
  366. <methodname>Zend_Ldap_Attribute::setAttribute()</methodname>.
  367. </entry>
  368. </row>
  369. <row>
  370. <entry>
  371. <code>Zend_Ldap_Node appendToAttribute(string $name, mixed
  372. $value)</code>
  373. </entry>
  374. <entry>
  375. Hängt etwas an ein <acronym>LDAP</acronym> Attribut an. Die
  376. Datenkonvertierung wird angewendet durch Verwendung von
  377. <methodname>Zend_Ldap_Attribute::setAttribute()</methodname>.
  378. </entry>
  379. </row>
  380. <row>
  381. <entry>
  382. <code>array|integer getDateTimeAttribute(string $name,
  383. integer|null $index)</code>
  384. </entry>
  385. <entry>
  386. Holt ein <acronym>LDAP</acronym> Date/Time Attribut. Die Datenkonvertierung
  387. wird angewendet durch Verwendung von
  388. <methodname>Zend_Ldap_Attribute::setDateTimeAttribute()</methodname>.
  389. </entry>
  390. </row>
  391. <row>
  392. <entry>
  393. <code>Zend_Ldap_Node setDateTimeAttribute(string $name,
  394. integer|array $value, boolean $utc)</code>
  395. </entry>
  396. <entry>
  397. Setzt ein <acronym>LDAP</acronym> Date/Time Attribut. Die Datenkonvertierung
  398. wird angewendet durch Verwendung von
  399. <methodname>Zend_Ldap_Attribute::setDateTimeAttribute()</methodname>.
  400. </entry>
  401. </row>
  402. <row>
  403. <entry>
  404. <code>Zend_Ldap_Node appendToDateTimeAttribute(string $name,
  405. integer|array $value, boolean $utc)</code>
  406. </entry>
  407. <entry>
  408. Hängt etwas an ein <acronym>LDAP</acronym> Date/Time Attribut an. Die
  409. Datenkonvertierung wird angewendet durch Verwendung von
  410. <methodname>Zend_Ldap_Attribute::setDateTimeAttribute()</methodname>.
  411. </entry>
  412. </row>
  413. <row>
  414. <entry>
  415. <code>Zend_Ldap_Node setPasswordAttribute(string $password,
  416. string $hashType, string $attribName)</code>
  417. </entry>
  418. <entry>
  419. Setzt ein <acronym>LDAP</acronym> Passwort bei
  420. <varname>$attribName</varname> (der Standardwert ist
  421. <code>'userPassword'</code>) auf <varname>$password</varname> mit dem
  422. Hashtyp <varname>$hashType</varname> (der Standardwert ist
  423. <constant>Zend_Ldap_Attribute::PASSWORD_HASH_MD5</constant>).
  424. </entry>
  425. </row>
  426. <row>
  427. <entry>
  428. <code>Zend_Ldap_Node deleteAttribute(string
  429. $name)</code>
  430. </entry>
  431. <entry>Löscht ein <acronym>LDAP</acronym> Attribut.</entry>
  432. </row>
  433. <row>
  434. <entry>
  435. <code>void removeDuplicatesFromAttribute(string
  436. $name)</code>
  437. </entry>
  438. <entry>
  439. Entfernt doppelte Werte von einem <acronym>LDAP</acronym> Attribut.
  440. </entry>
  441. </row>
  442. <row>
  443. <entry>
  444. <code>void removeFromAttribute(string $attribName,
  445. mixed|array $value)</code>
  446. </entry>
  447. <entry>
  448. Entfernt die angegebenen Werte von einem <acronym>LDAP</acronym> Attribut.
  449. </entry>
  450. </row>
  451. <row>
  452. <entry><code>boolean exists(Zend_Ldap $ldap)</code></entry>
  453. <entry>
  454. Prüft ob der aktuelle Node im angegebenen <acronym>LDAP</acronym> Server
  455. existiert (der aktuelle Server wird verwendet wenn
  456. <constant>NULL</constant> übergeben wird).
  457. </entry>
  458. </row>
  459. <row>
  460. <entry><code>Zend_Ldap_Node reload(Zend_Ldap $ldap)</code></entry>
  461. <entry>
  462. Lädt die Attribute des aktuellen Nodes nochmalig vom angegebenen
  463. <acronym>LDAP</acronym> Server (der aktuelle Server wird verwendet wenn
  464. <constant>NULL</constant> übergeben wird).
  465. </entry>
  466. </row>
  467. <row>
  468. <entry>
  469. <code>Zend_Ldap_Node_Collection
  470. searchSubtree(string|Zend_Ldap_Filter_Abstract $filter, integer
  471. $scope, string $sort)</code>
  472. </entry>
  473. <entry>
  474. Sucht den Unterbaum des Nodes mit dem angegebenen <varname>$filter</varname>
  475. und den angegebenen Suchparametern ab. Siehe
  476. <methodname>Zend_Ldap::search()</methodname> für Details über die
  477. Parameter <varname>$scope</varname> und <varname>$sort</varname>.
  478. </entry>
  479. </row>
  480. <row>
  481. <entry>
  482. <code>integer countSubtree(string|Zend_Ldap_Filter_Abstract
  483. $filter, integer $scope)</code>
  484. </entry>
  485. <entry>
  486. Zählt die Elemente des Unterbaums vom Node welche dem angegebenen
  487. <varname>$filter</varname> entsprechen und dem angegebenen Suchbereich.
  488. Siehe <methodname>Zend_Ldap::search()</methodname> für Details über den
  489. <varname>$scope</varname> Parameter.
  490. </entry>
  491. </row>
  492. <row>
  493. <entry><code>integer countChildren()</code></entry>
  494. <entry>Zählt die Kinder des Nodes.</entry>
  495. </row>
  496. <row>
  497. <entry>
  498. <code>Zend_Ldap_Node_Collection
  499. searchChildren(string|Zend_Ldap_Filter_Abstract $filter, string
  500. $sort)</code>
  501. </entry>
  502. <entry>
  503. Sucht nach Kindern des Nodes die dem angegebenen <varname>$filter</varname>
  504. entsprechen. Siehe <methodname>Zend_Ldap::search()</methodname> für Details
  505. über den <varname>$sort</varname> Parameter.
  506. </entry>
  507. </row>
  508. <row>
  509. <entry><code>boolean hasChildren()</code></entry>
  510. <entry>Gibt zurück ob der aktuelle Node Kinder hat.</entry>
  511. </row>
  512. <row>
  513. <entry>
  514. <code>Zend_Ldap_Node_ChildrenIterator
  515. getChildren()</code>
  516. </entry>
  517. <entry>Gibt alle Kinder des aktuellen Nodes zurück.</entry>
  518. </row>
  519. <row>
  520. <entry>
  521. <code>Zend_Ldap_Node getParent(Zend_Ldap
  522. $ldap)</code>
  523. </entry>
  524. <entry>
  525. Gibt den Elternteil des aktuellen Nodes zurück wobei die
  526. <acronym>LDAP</acronym> Verbindung <varname>$ldap</varname> verwendet wird
  527. (verwendet die aktuelle <acronym>LDAP</acronym> Verbindung wenn diese nicht
  528. angegeben wird).
  529. </entry>
  530. </row>
  531. </tbody>
  532. </tgroup>
  533. </table>
  534. </sect3>