Zend_Ldap-API.xml 165 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="zend.ldap.api">
  4. <title>API overview</title>
  5. <sect2 id="zend.ldap.api.configuration">
  6. <title>Configuration / options</title>
  7. <para>
  8. The <code>Zend_Ldap</code> component accepts an array of options either supplied
  9. to the constructor or through the <code>setOptions()</code> method. The permitted
  10. options are as follows:
  11. </para>
  12. <table id="zend.ldap.api.configuration.table">
  13. <title>Zend_Ldap Options</title>
  14. <tgroup cols="2">
  15. <thead>
  16. <row>
  17. <entry>Name</entry>
  18. <entry>Description</entry>
  19. </row>
  20. </thead>
  21. <tbody>
  22. <row>
  23. <entry>host</entry>
  24. <entry>
  25. The default hostname of LDAP server if not supplied to
  26. <code>connect()</code> (also may be used when trying to canonicalize
  27. usernames in <code>bind()</code>).
  28. </entry>
  29. </row>
  30. <row>
  31. <entry>port</entry>
  32. <entry>
  33. Default port of LDAP server if not supplied to
  34. <code>connect()</code>.
  35. </entry>
  36. </row>
  37. <row>
  38. <entry>useStartTls</entry>
  39. <entry>
  40. Whether or not the LDAP client should use TLS (aka SSLv2)
  41. encrypted transport. A value of <code>true</code> is strongly favored
  42. in production environments to prevent passwords from be transmitted in
  43. clear text. The default value is <code>false</code>, as servers
  44. frequently require that a certificate be installed separately after
  45. installation. The <code>useSsl</code> and <code>useStartTls</code>
  46. options are mutually exclusive. The <code>useStartTls</code> option
  47. should be favored over <code>useSsl</code> but not all servers support
  48. this newer mechanism.
  49. </entry>
  50. </row>
  51. <row>
  52. <entry>useSsl</entry>
  53. <entry>
  54. Whether or not the LDAP client should use SSL encrypted
  55. transport. The <code>useSsl</code> and <code>useStartTls</code> options
  56. are mutually exclusive.
  57. </entry>
  58. </row>
  59. <row>
  60. <entry>username</entry>
  61. <entry>
  62. The default credentials username. Some servers require that this
  63. be in DN form. This must be given in DN form if the LDAP server
  64. requires a DN to bind and binding should be possible with simple
  65. usernames.
  66. </entry>
  67. </row>
  68. <row>
  69. <entry>password</entry>
  70. <entry>
  71. The default credentials password (used only with username
  72. above).
  73. </entry>
  74. </row>
  75. <row>
  76. <entry>bindRequiresDn</entry>
  77. <entry>
  78. If <code>true</code>, this instructs <code>Zend_Ldap</code> to
  79. retrieve the DN for the account used to bind if the username is not
  80. already in DN form. The default value is <code>false</code>.
  81. </entry>
  82. </row>
  83. <row>
  84. <entry>baseDn</entry>
  85. <entry>
  86. The default base DN used for searching (e.g., for accounts).
  87. This option is required for most account related operations and should
  88. indicate the DN under which accounts are located.
  89. </entry>
  90. </row>
  91. <row>
  92. <entry>accountCanonicalForm</entry>
  93. <entry>
  94. A small integer indicating the form to which account names
  95. should be canonicalized. See the <link
  96. linkend="zend.ldap.introduction.theory-of-operations.account-name-canonicalization"> <emphasis>Account Name Canonicalization</emphasis></link>
  97. section below.
  98. </entry>
  99. </row>
  100. <row>
  101. <entry>accountDomainName</entry>
  102. <entry>
  103. The FQDN domain for which the target LDAP server is an authority
  104. (e.g., example.com).
  105. </entry>
  106. </row>
  107. <row>
  108. <entry>accountDomainNameShort</entry>
  109. <entry>
  110. The 'short' domain for which the target LDAP server is an
  111. authority. This is usually used to specify the NetBIOS domain name for
  112. Windows networks but may also be used by non-AD servers.
  113. </entry>
  114. </row>
  115. <row>
  116. <entry>accountFilterFormat</entry>
  117. <entry>
  118. The LDAP search filter used to search for accounts. This string
  119. is a <ulink url="http://php.net/sprintf"><code>sprintf()</code></ulink>
  120. style expression that must contain one '<code>%s</code>' to accommodate
  121. the username. The default value is
  122. '<code>(&amp;(objectClass=user)(sAMAccountName=%s))</code>' unless
  123. <code>bindRequiresDn</code> is set to <code>true</code>, in which case
  124. the default is
  125. '<code>(&amp;(objectClass=posixAccount)(uid=%s))</code>'. Users of
  126. custom schemas may need to change this option.
  127. </entry>
  128. </row>
  129. <row>
  130. <entry>allowEmptyPassword</entry>
  131. <entry>
  132. Some LDAP servers can be configured to accept an empty string
  133. password as an anonymous bind. This behavior is almost always
  134. undesirable. For this reason, empty passwords are explicitly
  135. disallowed. Set this value to <code>true</code> to allow an empty
  136. string password to be submitted during the bind.
  137. </entry>
  138. </row>
  139. <row>
  140. <entry>optReferrals</entry>
  141. <entry>
  142. If set to <code>true</code>, this option indicates to the LDAP
  143. client that referrals should be followed. The default value is
  144. <code>false</code>.
  145. </entry>
  146. </row>
  147. <row>
  148. <entry>tryUsernameSplit</entry>
  149. <entry>
  150. If set to <code>false</code>, this option indicates that the
  151. given username should not be split at the first <code>@</code> or
  152. <code>\</code> character to seperate the username from the domain
  153. during the binding-procedure. This allows the user to use usernames
  154. that contain an <code>@</code> or <code>\</code> character that do not
  155. inherit some domain-information, e.g. using email-addresses for
  156. binding. The default value is <code>true</code>.
  157. </entry>
  158. </row>
  159. </tbody>
  160. </tgroup>
  161. </table>
  162. </sect2>
  163. <sect2 id="zend.ldap.api.reference">
  164. <title>API Reference</title>
  165. <note>
  166. <para>Method names in <emphasis>italics</emphasis> are static methods.</para>
  167. </note>
  168. <sect3 id="zend.ldap.api.reference.zend-ldap">
  169. <title>Zend_Ldap</title>
  170. <para>
  171. <code>Zend_Ldap</code> is the base interface into a LDAP server. It provides
  172. connection and binding methods as well as methods to operate on the LDAP
  173. tree.
  174. </para>
  175. <table id="zend.ldap.api.reference.zend-ldap.table">
  176. <title>Zend_Ldap API</title>
  177. <tgroup cols="2">
  178. <thead>
  179. <row>
  180. <entry>Method</entry>
  181. <entry>Description</entry>
  182. </row>
  183. </thead>
  184. <tbody>
  185. <row>
  186. <entry>
  187. <emphasis> <code>string filterEscape(string $str)</code>
  188. </emphasis>
  189. </entry>
  190. <entry>
  191. Escapes a value to be used in a LDAP filter according to RFC
  192. 2254. This method is <emphasis>deprecated</emphasis>, please use
  193. <code>Zend_Ldap_Filter_Abstract::escapeValue()</code>
  194. instead.
  195. </entry>
  196. </row>
  197. <row>
  198. <entry>
  199. <emphasis> <code>boolean explodeDn($dn, array &amp;$keys =
  200. null, array &amp;$vals = null)</code> </emphasis>
  201. </entry>
  202. <entry>
  203. Checks if a given DN <code>$dn</code> is malformed. If
  204. <code>$keys</code> or <code>$keys</code> and <code>$vals</code> are
  205. given, these arrays will be filled with the appropriate DN keys and
  206. values. This method is <emphasis>deprecated</emphasis>, please use
  207. <code>Zend_Ldap_Dn::checkDn()</code> instead.
  208. </entry>
  209. </row>
  210. <row>
  211. <entry><code>__construct($options)</code></entry>
  212. <entry>
  213. Constructor. The <code>$options</code> parameter is optional
  214. and can be set to an array or a <code>Zend_Config</code> instance.
  215. If no options are provided at instantiation, the connection
  216. parameters must be passed to the instance using
  217. <code>Zend_Ldap::setOptions()</code>. The allowed options are
  218. specified in <link
  219. linkend="zend.ldap.using.theory-of-operation.options.table">Zend_Ldap
  220. Options</link>
  221. </entry>
  222. </row>
  223. <row>
  224. <entry><code>resource getResource()</code></entry>
  225. <entry>Returns the raw LDAP extension (ext/ldap) resource.</entry>
  226. </row>
  227. <row>
  228. <entry><code>integer getLastErrorCode()</code></entry>
  229. <entry>
  230. Returns the LDAP error number of the last LDAP
  231. command.
  232. </entry>
  233. </row>
  234. <row>
  235. <entry>
  236. <code>string getLastError(integer &amp;$errorCode, array
  237. &amp;$errorMessages)</code>
  238. </entry>
  239. <entry>
  240. Returns the LDAP error message of the last LDAP command. The
  241. optional <code>$errorCode</code> parameter is set to the LDAP error
  242. number when given. The optional <code>$errorMessages</code> array
  243. will be filled with the raw error messages when given. The various
  244. LDAP error retrieval functions can return different things, so they
  245. are all collected if <code>$errorMessages</code> is given.
  246. </entry>
  247. </row>
  248. <row>
  249. <entry><code>Zend_Ldap setOptions($options)</code></entry>
  250. <entry>
  251. Sets the LDAP connection and binding parameters.
  252. <code>$options</code> can be an array or an instance of
  253. <code>Zend_Config</code>. The allowed options are specified in
  254. <link
  255. linkend="zend.ldap.using.theory-of-operation.options.table">Zend_Ldap Options</link>
  256. </entry>
  257. </row>
  258. <row>
  259. <entry><code>array getOptions()</code></entry>
  260. <entry>
  261. Returns the current connection and binding
  262. parameters.
  263. </entry>
  264. </row>
  265. <row>
  266. <entry><code>string getBaseDn()</code></entry>
  267. <entry>
  268. Returns the base DN this LDAP connection is bound
  269. to.
  270. </entry>
  271. </row>
  272. <row>
  273. <entry>
  274. <code>string getCanonicalAccountName(string $acctname,
  275. integer $form)</code>
  276. </entry>
  277. <entry>
  278. Returns the canonical account name of the given account name
  279. <code>$acctname</code>. <code>$form</code> specifies the <link
  280. linkend="zend.ldap.using.theory-of-operation.account-name-canonicalization.table">format</link>
  281. into which the account name is canonicalized. See <link
  282. linkend="zend.ldap.introduction.theory-of-operations.account-name-canonicalization">Account Name Canonicalization</link>
  283. for more details.
  284. </entry>
  285. </row>
  286. <row>
  287. <entry><code>Zend_Ldap disconnect()</code></entry>
  288. <entry>
  289. Disconnects the Zend_Ldap instance from the LDAP
  290. server.
  291. </entry>
  292. </row>
  293. <row>
  294. <entry>
  295. <code>Zend_Ldap connect(string $host, integer $port, boolean
  296. $useSsl, boolean $useStartTls)</code>
  297. </entry>
  298. <entry>
  299. Connects the Zend_Ldap instance to the given LDAP server.
  300. All parameters are optional and will be taken from the LDAP
  301. connection and binding parameters passed to the instance via the
  302. construtor or via <code>Zend_Ldap::setOptions()</code> when set to
  303. <code>null</code>.
  304. </entry>
  305. </row>
  306. <row>
  307. <entry>
  308. <code>Zend_Ldap bind(string $username, string
  309. $password)</code>
  310. </entry>
  311. <entry>
  312. Authenticates <code>$username</code> with
  313. <code>$password</code> at the LDAP server. If both paramaters are
  314. omitted the binding will be carried out with the credentials given
  315. in the connection and binding parameters. If no credentials are
  316. given in the connection and binding parameters an anonymous bind
  317. will be performed. Note that this requires anonymous binds to be
  318. allowed on the LDAP server. An empty string <code>''</code> can be
  319. passed as <code>$password</code> together with a username if, and
  320. only if, <code>allowEmptyPassword</code> is set to
  321. <code>true</code> in the connection and binding parameters.
  322. </entry>
  323. </row>
  324. <row>
  325. <entry>
  326. <code>Zend_Ldap_Collection
  327. search(string|Zend_Ldap_Filter_Abstract $filter,
  328. string|Zend_Ldap_Dn $basedn, integer $scope, array $attributes,
  329. string $sort, string $collectionClass)</code>
  330. </entry>
  331. <entry>
  332. Searches the LDAP tree with the given <code>$filter</code>
  333. and the given search parameters.
  334. <variablelist>
  335. <varlistentry>
  336. <term><code>string|Zend_Ldap_Filter_Abstract
  337. $filter</code></term>
  338. <listitem>The filter string to be used in the search, e.g.
  339. <code>(objectClass=posixAccount)</code>.</listitem>
  340. </varlistentry>
  341. <varlistentry>
  342. <term><code>string|Zend_Ldap_Dn $basedn</code></term>
  343. <listitem>The search base for the search. If omitted or
  344. <code>null</code>, the <code>baseDn</code> from the
  345. connection and binding parameters is used.</listitem>
  346. </varlistentry>
  347. <varlistentry>
  348. <term><code>integer $scope</code></term>
  349. <listitem>The search scope.
  350. <code>Zend_Ldap::SEARCH_SCOPE_SUB</code> searches the
  351. complete subtree including the <code>$baseDn</code> node.
  352. <code>Zend_Ldap::SEARCH_SCOPE_ONE</code> restricts search
  353. to one level below <code>$baseDn</code>.
  354. <code>Zend_Ldap::SEARCH_SCOPE_BASE</code> restricts search
  355. to the <code>$baseDn</code> itself; this can be used to
  356. efficiently retrieve a single entry by its DN. The default
  357. value is
  358. <code>Zend_Ldap::SEARCH_SCOPE_SUB</code>.</listitem>
  359. </varlistentry>
  360. <varlistentry>
  361. <term><code>array $attributes</code></term>
  362. <listitem>Specifies the attributes contained in the
  363. returned entries. To include all possible attributes (ACL
  364. restrictions can disallow certain attribute to be retrieved
  365. by a given user) pass either an empty array
  366. <code>array()</code> or <code>array('*')</code> to the
  367. method. On some LDAP servers you can retrieve special
  368. internal attributes by passing <code>array('*', '+')</code>
  369. to the method.</listitem>
  370. </varlistentry>
  371. <varlistentry>
  372. <term><code>string $sort</code></term>
  373. <listitem>If given the result collection will be sorted
  374. after the attribute <code>$sort</code>. Results can only be
  375. sorted after one single attribute as this parameter uses
  376. the ext/ldap function <code>ldap_sort()</code>.</listitem>
  377. </varlistentry>
  378. <varlistentry>
  379. <term><code>string $collectionClass</code></term>
  380. <listitem>If given the result will be wrapped in an object
  381. of type <code>$collectionClass</code>. By default an object
  382. of type <code>Zend_Ldap_Collection</code> will be returned.
  383. The custom class must extend
  384. <code>Zend_Ldap_Collection</code> and will be passed a
  385. <code>Zend_Ldap_Collection_Iterator_Default</code> on
  386. instantiation.</listitem>
  387. </varlistentry>
  388. </variablelist>
  389. </entry>
  390. </row>
  391. <row>
  392. <entry>
  393. <code>integer count(string|Zend_Ldap_Filter_Abstract
  394. $filter, string|Zend_Ldap_Dn $basedn, integer
  395. $scope)</code>
  396. </entry>
  397. <entry>
  398. Counts the elements returned by the given search parameters.
  399. See <code>Zend_Ldap::search()</code> for a detailed description of
  400. the method parameters.
  401. </entry>
  402. </row>
  403. <row>
  404. <entry>
  405. <code>integer countChildren(string|Zend_Ldap_Dn
  406. $dn)</code>
  407. </entry>
  408. <entry>
  409. Counts the direct descendants (children) of the entry
  410. identified by the given <code>$dn</code>.
  411. </entry>
  412. </row>
  413. <row>
  414. <entry><code>boolean exists(string|Zend_Ldap_Dn $dn)</code></entry>
  415. <entry>
  416. Checks whether the entry identified by the given
  417. <code>$dn</code> exists.
  418. </entry>
  419. </row>
  420. <row>
  421. <entry>
  422. <code>array searchEntries(string|Zend_Ldap_Filter_Abstract
  423. $filter, string|Zend_Ldap_Dn $basedn, integer $scope, array
  424. $attributes, string $sort)</code>
  425. </entry>
  426. <entry>
  427. Performs a search operation and returns the result as an PHP
  428. array. This is essentially the same method as
  429. <code>Zend_Ldap::search()</code> except for the return type. See
  430. <code>Zend_Ldap::search()</code> for a detailed description of the
  431. method parameters.
  432. </entry>
  433. </row>
  434. <row>
  435. <entry>
  436. <code>array getEntry(string|Zend_Ldap_Dn $dn, array
  437. $attributes, boolean $throwOnNotFound)</code>
  438. </entry>
  439. <entry>
  440. Retrieves the LDAP entry identified by <code>$dn</code> with
  441. the attributes specified in <code>$attributes</code>. If
  442. <code>$attributes</code> is ommitted, all attributes
  443. (<code>array()</code>) are included in the result.
  444. <code>$throwOnNotFound</code> is <code>false</code> by default, so
  445. the method will return <code>null</code> if the specified entry
  446. cannot be found. If set to <code>true</code>, a
  447. <code>Zend_Ldap_Exception</code> will be thrown instead.
  448. </entry>
  449. </row>
  450. <row>
  451. <entry>
  452. <emphasis> <code>void prepareLdapEntryArray(array
  453. &amp;$entry)</code> </emphasis>
  454. </entry>
  455. <entry>
  456. Prepare an array for the use in LDAP modification
  457. operations. This method does not need to be called by the end-user
  458. as it's implicitly called on every data modification
  459. method.
  460. </entry>
  461. </row>
  462. <row>
  463. <entry>
  464. <code>Zend_Ldap add(string|Zend_Ldap_Dn $dn, array
  465. $entry)</code>
  466. </entry>
  467. <entry>
  468. Adds the entry identified by <code>$dn</code> with its
  469. attributes <code>$entry</code> to the LDAP tree. Throws a
  470. <code>Zend_Ldap_Exception</code> if the entry could not be
  471. added.
  472. </entry>
  473. </row>
  474. <row>
  475. <entry>
  476. <code>Zend_Ldap update(string|Zend_Ldap_Dn $dn, array
  477. $entry)</code>
  478. </entry>
  479. <entry>
  480. Updates the entry identified by <code>$dn</code> with its
  481. attributes <code>$entry</code> to the LDAP tree. Throws a
  482. <code>Zend_Ldap_Exception</code> if the entry could not be
  483. modified.
  484. </entry>
  485. </row>
  486. <row>
  487. <entry>
  488. <code>Zend_Ldap save(string|Zend_Ldap_Dn $dn, array
  489. $entry)</code>
  490. </entry>
  491. <entry>
  492. Saves the entry identified by <code>$dn</code> with its
  493. attributes <code>$entry</code> to the LDAP tree. Throws a
  494. <code>Zend_Ldap_Exception</code> if the entry could not be saved.
  495. This method decides by querying the LDAP tree if the entry will be
  496. added or updated.
  497. </entry>
  498. </row>
  499. <row>
  500. <entry>
  501. <code>Zend_Ldap delete(string|Zend_Ldap_Dn $dn, boolean
  502. $recursively)</code>
  503. </entry>
  504. <entry>
  505. Deletes the entry identified by <code>$dn</code> from the
  506. LDAP tree. Throws a <code>Zend_Ldap_Exception</code> if the entry
  507. could not be deleted. <code>$recursively</code> is
  508. <code>false</code> by default. If set to <code>true</code> the
  509. deletion will be carried out recursively and will effectively
  510. delete a complete subtree. Deletion will fail if
  511. <code>$recursively</code> is <code>false</code> and the entry
  512. <code>$dn</code> is not a leaf entry.
  513. </entry>
  514. </row>
  515. <row>
  516. <entry>
  517. <code>Zend_Ldap moveToSubtree(string|Zend_Ldap_Dn $from,
  518. string|Zend_Ldap_Dn $to, boolean $recursively, boolean
  519. $alwaysEmulate)</code>
  520. </entry>
  521. <entry>
  522. Moves the entry identified by <code>$from</code> to a
  523. location below <code>$to</code> keeping its RDN unchanged.
  524. <code>$recursively</code> specifies if the operation will be
  525. carried out recursively (<code>false</code> by default) so that the
  526. entry <code>$from</code> and all its descendants will be moved.
  527. Moving will fail if <code>$recursively</code> is <code>false</code>
  528. and the entry <code>$from</code> is not a leaf entry.
  529. <code>$alwaysEmulate</code> controls whether the ext/ldap function
  530. <code>ldap_rename()</code> should be used if available. This can
  531. only work for leaf entries and for servers and for ext/ldap
  532. supporting this function. Set to <code>true</code> to always use an
  533. emulated rename operation.
  534. <note>
  535. <para>All move-operations are carried out by copying and then
  536. deleting the corresponding entries in the LDAP tree. These
  537. operations are not <emphasis>atomic</emphasis> so that failures
  538. during the operation will result in an
  539. <emphasis>inconsistent</emphasis> state on the LDAP server. The
  540. same is true for all recursive operations. They also are by no
  541. means atomic. Please keep this in mind.
  542. </para>
  543. </note></entry>
  544. </row>
  545. <row>
  546. <entry>
  547. <code>Zend_Ldap move(string|Zend_Ldap_Dn $from,
  548. string|Zend_Ldap_Dn $to, boolean $recursively, boolean
  549. $alwaysEmulate)</code>
  550. </entry>
  551. <entry>
  552. This is an alias for
  553. <code>Zend_Ldap::rename()</code>.
  554. </entry>
  555. </row>
  556. <row>
  557. <entry>
  558. <code>Zend_Ldap rename(string|Zend_Ldap_Dn $from,
  559. string|Zend_Ldap_Dn $to, boolean $recursively, boolean
  560. $alwaysEmulate)</code>
  561. </entry>
  562. <entry>
  563. Renames the entry identified by <code>$from</code> to
  564. <code>$to</code>. <code>$recursively</code> specifies if the
  565. operation will be carried out recursively (<code>false</code> by
  566. default) so that the entry <code>$from</code> and all its
  567. descendants will be moved. Moving will fail if
  568. <code>$recursively</code> is <code>false</code> and the entry
  569. <code>$from</code> is not a leaf entry. <code>$alwaysEmulate</code>
  570. controls whether the ext/ldap function <code>ldap_rename()</code>
  571. should be used if available. This can only work for leaf entries
  572. and for servers and for ext/ldap supporting this function. Set to
  573. <code>true</code> to always use an emulated rename
  574. operation.
  575. </entry>
  576. </row>
  577. <row>
  578. <entry>
  579. <code>Zend_Ldap copyToSubtree(string|Zend_Ldap_Dn $from,
  580. string|Zend_Ldap_Dn $to, boolean $recursively)</code>
  581. </entry>
  582. <entry>
  583. Copies the entry identified by <code>$from</code> to a
  584. location below <code>$to</code> keeping its RDN unchanged.
  585. <code>$recursively</code> specifies if the operation will be
  586. carried out recursively (<code>false</code> by default) so that the
  587. entry <code>$from</code> and all its descendants will be copied.
  588. Copying will fail if <code>$recursively</code> is
  589. <code>false</code> and the entry <code>$from</code> is not a leaf
  590. entry.
  591. </entry>
  592. </row>
  593. <row>
  594. <entry>
  595. <code>Zend_Ldap copy(string|Zend_Ldap_Dn $from,
  596. string|Zend_Ldap_Dn $to, boolean $recursively)</code>
  597. </entry>
  598. <entry>
  599. Copies the entry identified by <code>$from</code> to
  600. <code>$to</code>. <code>$recursively</code> specifies if the
  601. operation will be carried out recursively (<code>false</code> by
  602. default) so that the entry <code>$from</code> and all its
  603. descendants will be copied. Copying will fail if
  604. <code>$recursively</code> is <code>false</code> and the entry
  605. <code>$from</code> is not a leaf entry.
  606. </entry>
  607. </row>
  608. <row>
  609. <entry>
  610. <code>Zend_Ldap_Node getNode(string|Zend_Ldap_Dn
  611. $dn)</code>
  612. </entry>
  613. <entry>
  614. Returns the entry <code>$dn</code> wrapped in a
  615. <code>Zend_Ldap_Node</code>.
  616. </entry>
  617. </row>
  618. <row>
  619. <entry><code>Zend_Ldap_Node getBaseNode()</code></entry>
  620. <entry>
  621. Returns the entry for the base DN <code>$baseDn</code>
  622. wrapped in a <code>Zend_Ldap_Node</code>.
  623. </entry>
  624. </row>
  625. <row>
  626. <entry><code>Zend_Ldap_Node_RootDse getRootDse()</code></entry>
  627. <entry>Returns the RootDSE for the current server.</entry>
  628. </row>
  629. <row>
  630. <entry><code>Zend_Ldap_Node_Schema getSchema()</code></entry>
  631. <entry>Returns the LDAP schema for the current server.</entry>
  632. </row>
  633. </tbody>
  634. </tgroup>
  635. </table>
  636. <sect4 id="zend.ldap.api.reference.zend-ldap.zend-ldap-collection">
  637. <title>Zend_Ldap_Collection</title>
  638. <para>
  639. <code>Zend_Ldap_Collection</code> implements <code>Iterator</code> to
  640. allow for item traversal using <code>foreach()</code> and
  641. <code>Countable</code> to be able to respond to <code>count()</code>. With its
  642. protected <code>_createEntry()</code> method it provides a simple extension
  643. point for developers needing custom result objects.
  644. </para>
  645. <table id="zend.ldap.api.reference.zend-collection.table">
  646. <title>Zend_Ldap_Collection API</title>
  647. <tgroup cols="2">zend.ldap.api.reference.zend-ldap.zend-ldap-collection
  648. <thead>
  649. <row>
  650. <entry>Method</entry>
  651. <entry>Description</entry>
  652. </row>
  653. </thead>
  654. <tbody>
  655. <row>
  656. <entry>
  657. <code>__construct(Zend_Ldap_Collection_Iterator_Interface
  658. $iterator)</code>
  659. </entry>
  660. <entry>
  661. Constructor. The constrcutor must be provided by a
  662. <code>Zend_Ldap_Collection_Iterator_Interface</code> which does the
  663. real result iteration.
  664. <code>Zend_Ldap_Collection_Iterator_Default</code> is the default
  665. implementation for iterating ext/ldap results.
  666. </entry>
  667. </row>
  668. <row>
  669. <entry><code>boolean close()</code></entry>
  670. <entry>
  671. Closes the internal iterator. This is also called in the
  672. destructor.
  673. </entry>
  674. </row>
  675. <row>
  676. <entry><code>array toArray()</code></entry>
  677. <entry>Returns all entries as an array.</entry>
  678. </row>
  679. <row>
  680. <entry><code>array getFirst()</code></entry>
  681. <entry>
  682. Returns the first entry in the collection or
  683. <code>null</code> if the collection is empty.
  684. </entry>
  685. </row>
  686. </tbody></tgroup>
  687. </table>
  688. </sect4>
  689. </sect3>
  690. <sect3 id="zend.ldap.api.reference.zend-ldap-attribute">
  691. <title>Zend_Ldap_Attribute</title>
  692. <para>
  693. <code>Zend_Ldap_Attribute</code> is a helper class providing only static
  694. methods to manipulate arrays suitable to the structure used in
  695. <code>Zend_Ldap</code> data modification methods and to the data format required by
  696. the LDAP server. PHP data types are converted the following way:
  697. </para>
  698. <variablelist>
  699. <varlistentry>
  700. <term><code>string</code></term>
  701. <listitem>No conversion will be done.</listitem>
  702. </varlistentry>
  703. <varlistentry>
  704. <term><code>integer</code> and <code>float</code></term>
  705. <listitem>The value will be converted to a string.</listitem>
  706. </varlistentry>
  707. <varlistentry>
  708. <term><code>boolean</code></term>
  709. <listitem><code>true</code> will be converted to <code>'TRUE'</code> and
  710. <code>false</code> to <code>'FALSE'</code></listitem>
  711. </varlistentry>
  712. <varlistentry>
  713. <term><code>object</code> and <code>array</code></term>
  714. <listitem>The value will be converted to a string by using
  715. <code>serialize()</code>.</listitem>
  716. </varlistentry>
  717. <varlistentry>
  718. <term><code>resource</code></term>
  719. <listitem>If a <code>stream</code> resource is given, the data will be
  720. fetched by calling <code>stream_get_contents()</code>.</listitem>
  721. </varlistentry>
  722. <varlistentry>
  723. <term>others</term>
  724. <listitem>All other data types (namely non-stream resources) will be
  725. ommitted.</listitem>
  726. </varlistentry>
  727. </variablelist>
  728. <para>On reading attribute values the following conversion will take place:</para>
  729. <variablelist>
  730. <varlistentry>
  731. <term><code>'TRUE'</code></term>
  732. <listitem>Converted to <code>true</code>.</listitem>
  733. </varlistentry>
  734. <varlistentry>
  735. <term><code>'FALSE'</code></term>
  736. <listitem>Converted to <code>false</code>.</listitem>
  737. </varlistentry>
  738. <varlistentry>
  739. <term>others</term>
  740. <listitem>All other strings won't be automatically converted and are passed
  741. as they are.</listitem>
  742. </varlistentry>
  743. </variablelist>
  744. <table id="zend.ldap.api.reference.zend-ldap-attribute">
  745. <title>Zend_Ldap_Attribute API</title>
  746. <tgroup cols="2">
  747. <thead>
  748. <row>
  749. <entry>Method</entry>
  750. <entry>Description</entry>
  751. </row>
  752. </thead>
  753. <tbody>
  754. <row>
  755. <entry>
  756. <emphasis> <code>void setAttribute(array &amp;$data, string
  757. $attribName, mixed $value, boolean $append)</code>
  758. </emphasis>
  759. </entry>
  760. <entry>
  761. Sets the attribute <code>$attribName</code> in
  762. <code>$data</code> to the value <code>$value</code>. If
  763. <code>$append</code> is <code>true</code> (<code>false</code> by
  764. default) <code>$value</code> will be appended to the attribute.
  765. <code>$value</code> can be a scalar value or an array of scalar
  766. values. Conversion will take place.
  767. </entry>
  768. </row>
  769. <row>
  770. <entry>
  771. <emphasis> <code>array|mixed getAttribute(array $data,
  772. string $attribName, integer|null $index)</code> </emphasis>
  773. </entry>
  774. <entry>
  775. Returns the attribute <code>$attribName</code> from
  776. <code>$data</code>. If <code>$index</code> is <code>null</code>
  777. (default) an array will be returned containing all the values for
  778. the given attribute. An empty array will be returned if the
  779. attribute does not exist in the given array. If an integer index is
  780. specified the corresponding value at the given index will be
  781. returned. If the index is out of bounds, <code>null</code> will be
  782. returned. Conversion will take place.
  783. </entry>
  784. </row>
  785. <row>
  786. <entry>
  787. <emphasis> <code>boolean attributeHasValue(array &amp;$data,
  788. string $attribName, mixed|array $value)</code> </emphasis>
  789. </entry>
  790. <entry>
  791. Checks if the attribute <code>$attribName</code> in
  792. <code>$data</code> has the value(s) given in <code>$value</code>.
  793. The method returns <code>true</code> only if all values in
  794. <code>$value</code> are present in the attribute. Comparison is
  795. done strictly (respecting the data type).
  796. </entry>
  797. </row>
  798. <row>
  799. <entry>
  800. <emphasis> <code>void removeDuplicatesFromAttribute(array
  801. &amp;$data, string $attribName)</code> </emphasis>
  802. </entry>
  803. <entry>
  804. Removes all duplicates from the attribute
  805. <code>$attribName</code> in <code>$data</code>.
  806. </entry>
  807. </row>
  808. <row>
  809. <entry>
  810. <emphasis> <code>void removeFromAttribute(array &amp;$data,
  811. string $attribName, mixed|array $value)</code> </emphasis>
  812. </entry>
  813. <entry>
  814. Removes the the value(s) given in <code>$value</code> from
  815. the attribute <code>$attribName</code> in
  816. <code>$data</code>.
  817. </entry>
  818. </row>
  819. <row>
  820. <entry>
  821. <emphasis> <code>string|null convertToLdapValue(mixed
  822. $value)</code> </emphasis>
  823. </entry>
  824. <entry>
  825. Converts a PHP data type into its LDAP representation. See
  826. introduction for details.
  827. </entry>
  828. </row>
  829. <row>
  830. <entry>
  831. <emphasis> <code>mixed convertFromLdapValue(string
  832. $value)</code> </emphasis>
  833. </entry>
  834. <entry>
  835. Converts an LDAP value into its PHP data type. See
  836. introduction for details.
  837. </entry>
  838. </row>
  839. <row>
  840. <entry>
  841. <emphasis> <code>string|null
  842. convertToLdapDateTimeValue(integer $value, boolean $utc)</code>
  843. </emphasis>
  844. </entry>
  845. <entry>
  846. Converts a timestamp into its LDAP date/time representation.
  847. If <code>$utc</code> is <code>true</code> (<code>false</code> by
  848. default) the resulting LDAP date/time string will be in UTC,
  849. otherwise a local date/time string will be returned.
  850. </entry>
  851. </row>
  852. <row>
  853. <entry>
  854. <emphasis> <code>integer|null
  855. convertFromLdapDateTimeValue(string $value)</code>
  856. </emphasis>
  857. </entry>
  858. <entry>
  859. Converts LDAP date/time representation into a timestamp. The
  860. method returns <code>null</code> if <code>$value</code> can not be
  861. converted back into a PHP timestamp.
  862. </entry>
  863. </row>
  864. <row>
  865. <entry>
  866. <emphasis> <code>void setPassword(array &amp;$data, string
  867. $password, string $hashType, string $attribName)</code>
  868. </emphasis>
  869. </entry>
  870. <entry>
  871. Sets a LDAP password for the the attribute
  872. <code>$attribName</code> in <code>$data</code>.
  873. <code>$attribName</code> defaults to <code>'userPassword'</code>
  874. which is the standard password attribute. The password hash can be
  875. specified with <code>$hashType</code>. The default value here is
  876. <code>Zend_Ldap_Attribute::PASSWORD_HASH_MD5</code> with
  877. <code>Zend_Ldap_Attribute::PASSWORD_HASH_SHA</code> as the other
  878. possibilty.
  879. </entry>
  880. </row>
  881. <row>
  882. <entry>
  883. <emphasis> <code>string createPassword(string $password,
  884. string $hashType)</code> </emphasis>
  885. </entry>
  886. <entry>
  887. Creates a LDAP password. The password hash can be specified
  888. with <code>$hashType</code>. The default value here is
  889. <code>Zend_Ldap_Attribute::PASSWORD_HASH_MD5</code> with
  890. <code>Zend_Ldap_Attribute::PASSWORD_HASH_SHA</code> as the other
  891. possibilty.
  892. </entry>
  893. </row>
  894. <row>
  895. <entry>
  896. <emphasis> <code>void setDateTimeAttribute(array &amp;$data,
  897. string $attribName, integer|array $value, boolean $utc, boolean
  898. $append)</code> </emphasis>
  899. </entry>
  900. <entry>
  901. Sets the attribute <code>$attribName</code> in
  902. <code>$data</code> to the date/time value <code>$value</code>. If
  903. <code>$append</code> is <code>true</code> (<code>false</code> by
  904. default) <code>$value</code> will be appended to the attribute.
  905. <code>$value</code> can be an integer value or an array of
  906. integers. Date-time-conversion according to
  907. <code>Zend_Ldap_Attribute::convertToLdapDateTimeValue()</code> will
  908. take place.
  909. </entry>
  910. </row>
  911. <row>
  912. <entry>
  913. <emphasis> <code>array|integer getDateTimeAttribute(array
  914. $data, string $attribName, integer|null $index)</code>
  915. </emphasis>
  916. </entry>
  917. <entry>
  918. Returns the date/time attribute <code>$attribName</code>
  919. from <code>$data</code>. If <code>$index</code> is
  920. <code>null</code> (default) an array will be returned containing
  921. all the date/time values for the given attribute. An empty array
  922. will be returned if the attribute does not exist in the given
  923. array. If an integer index is specified the corresponding date/time
  924. value at the given index will be returned. If the index is out of
  925. bounds, <code>null</code> will be returned. Date-time-conversion
  926. according to
  927. <code>Zend_Ldap_Attribute::convertFromLdapDateTimeValue()</code>
  928. will take place.
  929. </entry>
  930. </row>
  931. </tbody>
  932. </tgroup>
  933. </table>
  934. </sect3>
  935. <sect3 id="zend.ldap.api.reference.zend-ldap-dn">
  936. <title>Zend_Ldap_Dn</title>
  937. <para>
  938. <code>Zend_Ldap_Dn</code> provides an object-oriented interface to
  939. manipulating LDAP distinguished names (DN). The parameter <code>$caseFold</code>
  940. that is used in several methods determines the way DN attributes are handled
  941. regarding their case. Allowed values for this paraneter are:
  942. </para>
  943. <variablelist>
  944. <varlistentry>
  945. <term><code>Zend_Ldap_Dn::ATTR_CASEFOLD_NONE</code></term>
  946. <listitem>No case-folding will be done.</listitem>
  947. </varlistentry>
  948. <varlistentry>
  949. <term><code>Zend_Ldap_Dn::ATTR_CASEFOLD_UPPER</code></term>
  950. <listitem>All attributes will be converted to upper-case.</listitem>
  951. </varlistentry>
  952. <varlistentry>
  953. <term><code>Zend_Ldap_Dn::ATTR_CASEFOLD_LOWER</code></term>
  954. <listitem>All attributes will be converted to lower-case.</listitem>
  955. </varlistentry>
  956. </variablelist>
  957. <para>
  958. The default case-folding is <code>Zend_Ldap_Dn::ATTR_CASEFOLD_NONE</code> and
  959. can be set with <code>Zend_Ldap_Dn::setDefaultCaseFold()</code>. Each instance of
  960. <code>Zend_Ldap_Dn</code> can have its own case-folding-setting. If the
  961. <code>$caseFold</code> parameter is ommitted in method-calls it defaults to the
  962. instance's case-folding setting.
  963. </para>
  964. <para>
  965. The class implements <code>ArrayAccess</code> to allow indexer-access to the
  966. different parts of the DN. The <code>ArrayAccess</code>-methods proxy to
  967. <code>Zend_Ldap_Dn::get($offset, 1, null)</code> for <code>offsetGet(integer
  968. $offset)</code>, to <code>Zend_Ldap_Dn::set($offset, $value)</code> for
  969. <code>offsetSet()</code> and to <code>Zend_Ldap_Dn::remove($offset, 1)</code> for
  970. <code>offsetUnset()</code>. <code>offsetExists()</code> simply checks if the index
  971. is within the bounds.
  972. </para>
  973. <table id="zend.ldap.api.reference.zend-ldap-dn">
  974. <title>Zend_Ldap_Dn API</title>
  975. <tgroup cols="2">
  976. <thead>
  977. <row>
  978. <entry>Method</entry>
  979. <entry>Description</entry>
  980. </row>
  981. </thead>
  982. <tbody>
  983. <row>
  984. <entry>
  985. <emphasis> <code>Zend_Ldap_Dn factory(string|array $dn,
  986. string|null $caseFold)</code> </emphasis>
  987. </entry>
  988. <entry>
  989. Creates a <code>Zend_Ldap_Dn</code> instance from an array
  990. or a string. The array must conform to the array structure detailed
  991. under <code>Zend_Ldap_Dn::implodeDn()</code>.
  992. </entry>
  993. </row>
  994. <row>
  995. <entry>
  996. <emphasis> <code>Zend_Ldap_Dn fromString(string $dn,
  997. string|null $caseFold)</code> </emphasis>
  998. </entry>
  999. <entry>
  1000. Creates a <code>Zend_Ldap_Dn</code> instance from a
  1001. string.
  1002. </entry>
  1003. </row>
  1004. <row>
  1005. <entry>
  1006. <emphasis> <code>Zend_Ldap_Dn fromArray(array $dn,
  1007. string|null $caseFold)</code> </emphasis>
  1008. </entry>
  1009. <entry>
  1010. Creates a <code>Zend_Ldap_Dn</code> instance from an array.
  1011. The array must conform to the array structure detailed under
  1012. <code>Zend_Ldap_Dn::implodeDn()</code>.
  1013. </entry>
  1014. </row>
  1015. <row>
  1016. <entry><code>array getRdn(string|null $caseFold)</code></entry>
  1017. <entry>
  1018. Gets the RDN of the current DN. The return value is an array
  1019. with the RDN attribute names its keys and the RDN attribute
  1020. values.
  1021. </entry>
  1022. </row>
  1023. <row>
  1024. <entry>
  1025. <code>string getRdnString(string|null
  1026. $caseFold)</code>
  1027. </entry>
  1028. <entry>
  1029. Gets the RDN of the current DN. The return value is a
  1030. string.
  1031. </entry>
  1032. </row>
  1033. <row>
  1034. <entry>
  1035. <code>Zend_Ldap_Dn getParentDn(integer
  1036. $levelUp)</code>
  1037. </entry>
  1038. <entry>
  1039. Gets the DN of the current DN's ancestor
  1040. <code>$levelUp</code> levels up the tree. <code>$levelUp</code>
  1041. defaults to <code>1</code>.
  1042. </entry>
  1043. </row>
  1044. <row>
  1045. <entry>
  1046. <code>array get(integer $index, integer $length, string|null
  1047. $caseFold)</code>
  1048. </entry>
  1049. <entry>
  1050. Returns a slice of the current DN determined by
  1051. <code>$index</code> and <code>$length</code>. <code>$index</code>
  1052. starts with <code>0</code> on the DN part from the left.
  1053. </entry>
  1054. </row>
  1055. <row>
  1056. <entry>
  1057. <code>Zend_Ldap_Dn set(integer $index, array
  1058. $value)</code>
  1059. </entry>
  1060. <entry>
  1061. Replaces a DN part in the current DN. This operation
  1062. manipulates the current instance.
  1063. </entry>
  1064. </row>
  1065. <row>
  1066. <entry>
  1067. <code>Zend_Ldap_Dn remove(integer $index, integer
  1068. $length)</code>
  1069. </entry>
  1070. <entry>
  1071. Removes a DN part from the current DN. This operation
  1072. manipulates the current instance. <code>$length</code> defaults to
  1073. <code>1</code>
  1074. </entry>
  1075. </row>
  1076. <row>
  1077. <entry><code>Zend_Ldap_Dn append(array $value)</code></entry>
  1078. <entry>
  1079. Appends a DN part to the current DN. This operation
  1080. manipulates the current instance.
  1081. </entry>
  1082. </row>
  1083. <row>
  1084. <entry><code>Zend_Ldap_Dn prepend(array $value)</code></entry>
  1085. <entry>
  1086. Prepends a DN part to the current DN. This operation
  1087. manipulates the current instance.
  1088. </entry>
  1089. </row>
  1090. <row>
  1091. <entry>
  1092. <code>Zend_Ldap_Dn insert(integer $index, array
  1093. $value)</code>
  1094. </entry>
  1095. <entry>
  1096. Inserts a DN part after the index <code>$index</code> to the
  1097. current DN. This operation manipulates the current
  1098. instance.
  1099. </entry>
  1100. </row>
  1101. <row>
  1102. <entry><code>void setCaseFold(string|null $caseFold)</code></entry>
  1103. <entry>
  1104. Sets the case-folding option to the current DN instance. If
  1105. <code>$caseFold</code> is null the default case-folding setting
  1106. (<code>Zend_Ldap_Dn::ATTR_CASEFOLD_NONE</code> by default or set
  1107. via <code>Zend_Ldap_Dn::setDefaultCaseFold()</code> will be set for
  1108. the current instance.
  1109. </entry>
  1110. </row>
  1111. <row>
  1112. <entry><code>string toString(string|null $caseFold)</code></entry>
  1113. <entry>Returns DN as a string.</entry>
  1114. </row>
  1115. <row>
  1116. <entry><code>array toArray(string|null $caseFold)</code></entry>
  1117. <entry>Returns DN as an array.</entry>
  1118. </row>
  1119. <row>
  1120. <entry><code>string __toString()</code></entry>
  1121. <entry>
  1122. Returns DN as a string - proxies to
  1123. <code>Zend_Ldap_Dn::toString(null)</code>.
  1124. </entry>
  1125. </row>
  1126. <row>
  1127. <entry>
  1128. <emphasis> <code>void setDefaultCaseFold(string
  1129. $caseFold)</code> </emphasis>
  1130. </entry>
  1131. <entry>
  1132. Sets the default case-folding option used by all instances
  1133. on creation by default. Already existing instances are not affected
  1134. by this setting.
  1135. </entry>
  1136. </row>
  1137. <row>
  1138. <entry>
  1139. <emphasis> <code>array escapeValue(string|array
  1140. $values)</code> </emphasis>
  1141. </entry>
  1142. <entry>Escapes a DN value according to RFC 2253.</entry>
  1143. </row>
  1144. <row>
  1145. <entry>
  1146. <emphasis> <code>array unescapeValue(string|array
  1147. $values)</code> </emphasis>
  1148. </entry>
  1149. <entry>
  1150. Undoes the conversion done by
  1151. <code>Zend_Ldap_Dn::escapeValue()</code>.
  1152. </entry>
  1153. </row>
  1154. <row>
  1155. <entry>
  1156. <emphasis> <code>array explodeDn(string $dn, array
  1157. &amp;$keys, array &amp;$vals, string|null $caseFold)</code>
  1158. </emphasis>
  1159. </entry>
  1160. <entry>
  1161. Explodes the DN <code>$dn</code> into an array containing
  1162. all parts of the given DN. <code>$keys</code> optinally receive DN
  1163. keys (e.g. CN, OU, DC, ...). <code>$vals</code> optionally receive
  1164. DN values. The resulting array will be of type
  1165. <programlisting role="php"><![CDATA[
  1166. array(
  1167. array("cn" => "name1", "uid" => "user"),
  1168. array("cn" => "name2"),
  1169. array("dc" => "example"),
  1170. array("dc" => "org")
  1171. )
  1172. ]]></programlisting>for a DN of <code>cn=name1+uid=user,cn=name2,dc=example,dc=org</code>.
  1173. </entry>
  1174. </row>
  1175. <row>
  1176. <entry>
  1177. <emphasis> <code>boolean checkDn(string $dn, array
  1178. &amp;$keys, array &amp;$vals, string|null $caseFold)</code>
  1179. </emphasis>
  1180. </entry>
  1181. <entry>
  1182. Checks if a given DN <code>$dn</code> is malformed. If
  1183. <code>$keys</code> or <code>$keys</code> and <code>$vals</code> are
  1184. given, these arrays will be filled with the appropriate DN keys and
  1185. values.
  1186. </entry>
  1187. </row>
  1188. <row>
  1189. <entry>
  1190. <emphasis> <code>string implodeRdn(array $part, string|null
  1191. $caseFold)</code> </emphasis>
  1192. </entry>
  1193. <entry>
  1194. Returns a DN part in the form
  1195. <code>$attribute=$value</code>
  1196. </entry>
  1197. </row>
  1198. <row>
  1199. <entry>
  1200. <emphasis> <code>string implodeDn(array $dnArray,
  1201. string|null $caseFold, string $separator)</code>
  1202. </emphasis>
  1203. </entry>
  1204. <entry>
  1205. Implodes an array in the form delivered by
  1206. <code>Zend_Ldap_Dn::explodeDn()</code> to a DN string.
  1207. <code>$separator</code> defaults to <code>','</code> but some LDAP
  1208. servers also understand <code>';'</code>. <code>$dnArray</code>
  1209. must of type
  1210. <programlisting role="php"><![CDATA[
  1211. array(
  1212. array("cn" => "name1", "uid" => "user"),
  1213. array("cn" => "name2"),
  1214. array("dc" => "example"),
  1215. array("dc" => "org")
  1216. )
  1217. ]]></programlisting>
  1218. </entry>
  1219. </row>
  1220. <row>
  1221. <entry>
  1222. <emphasis> <code>boolean isChildOf(string|Zend_Ldap_Dn
  1223. $childDn, string|Zend_Ldap_Dn $parentDn)</code> </emphasis>
  1224. </entry>
  1225. <entry>
  1226. Checks if given <code>$childDn</code> is beneath
  1227. <code>$parentDn</code> subtree.
  1228. </entry>
  1229. </row>
  1230. </tbody>
  1231. </tgroup>
  1232. </table>
  1233. </sect3>
  1234. <sect3 id="zend.ldap.api.reference.zend-ldap-filter">
  1235. <title>Zend_Ldap_Filter</title>
  1236. <table id="zend.ldap.api.reference.zend-filter.table">
  1237. <title>Zend_Ldap_Filter API</title>
  1238. <tgroup cols="2">
  1239. <thead>
  1240. <row>
  1241. <entry>Method</entry>
  1242. <entry>Description</entry>
  1243. </row>
  1244. </thead>
  1245. <tbody>
  1246. <row>
  1247. <entry>
  1248. <emphasis> <code>Zend_Ldap_Filter equals(string $attr,
  1249. string $value)</code> </emphasis>
  1250. </entry>
  1251. <entry>
  1252. Creates an 'equals' filter:
  1253. <code>(attr=value)</code>.
  1254. </entry>
  1255. </row>
  1256. <row>
  1257. <entry>
  1258. <emphasis> <code>Zend_Ldap_Filter begins(string $attr,
  1259. string $value)</code> </emphasis>
  1260. </entry>
  1261. <entry>
  1262. Creates an 'begins with' filter:
  1263. <code>(attr=value*)</code>.
  1264. </entry>
  1265. </row>
  1266. <row>
  1267. <entry>
  1268. <emphasis> <code>Zend_Ldap_Filter ends(string $attr, string
  1269. $value)</code> </emphasis>
  1270. </entry>
  1271. <entry>
  1272. Creates an 'ends with' filter:
  1273. <code>(attr=*value)</code>.
  1274. </entry>
  1275. </row>
  1276. <row>
  1277. <entry>
  1278. <emphasis> <code>Zend_Ldap_Filter contains(string $attr,
  1279. string $value)</code> </emphasis>
  1280. </entry>
  1281. <entry>
  1282. Creates an 'contains' filter:
  1283. <code>(attr=*value*)</code>.
  1284. </entry>
  1285. </row>
  1286. <row>
  1287. <entry>
  1288. <emphasis> <code>Zend_Ldap_Filter greater(string $attr,
  1289. string $value)</code> </emphasis>
  1290. </entry>
  1291. <entry>
  1292. Creates an 'greater' filter:
  1293. <code>(attr&gt;value)</code>.
  1294. </entry>
  1295. </row>
  1296. <row>
  1297. <entry>
  1298. <emphasis> <code>Zend_Ldap_Filter greaterOrEqual(string
  1299. $attr, string $value)</code> </emphasis>
  1300. </entry>
  1301. <entry>
  1302. Creates an 'greater or equal' filter:
  1303. <code>(attr&gt;=value)</code>.
  1304. </entry>
  1305. </row>
  1306. <row>
  1307. <entry>
  1308. <emphasis> <code>Zend_Ldap_Filter less(string $attr, string
  1309. $value)</code> </emphasis>
  1310. </entry>
  1311. <entry>
  1312. Creates an 'less' filter:
  1313. <code>(attr&lt;value)</code>.
  1314. </entry>
  1315. </row>
  1316. <row>
  1317. <entry>
  1318. <emphasis> <code>Zend_Ldap_Filter lessOrEqual(string $attr,
  1319. string $value)</code> </emphasis>
  1320. </entry>
  1321. <entry>
  1322. Creates an 'less or equal' filter:
  1323. <code>(attr&lt;=value)</code>.
  1324. </entry>
  1325. </row>
  1326. <row>
  1327. <entry>
  1328. <emphasis> <code>Zend_Ldap_Filter approx(string $attr,
  1329. string $value)</code> </emphasis>
  1330. </entry>
  1331. <entry>
  1332. Creates an 'approx' filter:
  1333. <code>(attr~=value)</code>.
  1334. </entry>
  1335. </row>
  1336. <row>
  1337. <entry>
  1338. <emphasis> <code>Zend_Ldap_Filter any(string $attr)</code>
  1339. </emphasis>
  1340. </entry>
  1341. <entry>Creates an 'any' filter: <code>(attr=*)</code>.</entry>
  1342. </row>
  1343. <row>
  1344. <entry>
  1345. <emphasis> <code>Zend_Ldap_Filter string(string
  1346. $filter)</code> </emphasis>
  1347. </entry>
  1348. <entry>
  1349. Creates a simple custom string filter. The user is
  1350. responsible for all value-escaping as the filter is used as
  1351. is.
  1352. </entry>
  1353. </row>
  1354. <row>
  1355. <entry>
  1356. <emphasis> <code>Zend_Ldap_Filter mask(string $mask, string
  1357. $value,...)</code> </emphasis>
  1358. </entry>
  1359. <entry>
  1360. Creates a filter from a string mask. All <code>$value</code>
  1361. parameters will be escaped and substituted into <code>$mask</code>
  1362. by using
  1363. <ulink url="http://php.net/sprintf">
  1364. <code>sprintf()</code></ulink>
  1365. </entry>
  1366. </row>
  1367. <row>
  1368. <entry>
  1369. <emphasis> <code>Zend_Ldap_Filter
  1370. andFilter(Zend_Ldap_Filter_Abstract $filter,...)</code>
  1371. </emphasis>
  1372. </entry>
  1373. <entry>Creates an 'and' filter from all arguments given.</entry>
  1374. </row>
  1375. <row>
  1376. <entry>
  1377. <emphasis> <code>Zend_Ldap_Filter
  1378. orFilter(Zend_Ldap_Filter_Abstract $filter,...)</code>
  1379. </emphasis>
  1380. </entry>
  1381. <entry>Creates an 'or' filter from all arguments given.</entry>
  1382. </row>
  1383. <row>
  1384. <entry>
  1385. <code>__construct(string $attr, string $value, string
  1386. $filtertype, string|null $prepend, string|null
  1387. $append)</code>
  1388. </entry>
  1389. <entry>
  1390. Constructor. Creates an arbitrary filter according to the
  1391. parameters supplied. The resulting filter will be a concatenation
  1392. <code>$attr . $filtertype . $prepend . $value . $append</code>.
  1393. Normally this constructor is not needed as all filters can be
  1394. created by using the apprpriate factory methods.
  1395. </entry>
  1396. </row>
  1397. <row>
  1398. <entry><code>string toString()</code></entry>
  1399. <entry>Returns a string representation of the filter.</entry>
  1400. </row>
  1401. <row>
  1402. <entry><code>string __toString()</code></entry>
  1403. <entry>
  1404. Returns a string representation of the filter. Proxies to
  1405. <code>Zend_Ldap_Filter::toString()</code>.
  1406. </entry>
  1407. </row>
  1408. <row>
  1409. <entry><code>Zend_Ldap_Filter_Abstract negate()</code></entry>
  1410. <entry>Negates the current filter.</entry>
  1411. </row>
  1412. <row>
  1413. <entry>
  1414. <code>Zend_Ldap_Filter_Abstract
  1415. addAnd(Zend_Ldap_Filter_Abstract $filter,...)</code>
  1416. </entry>
  1417. <entry>
  1418. Creates an 'and' filter from the current filter and all
  1419. filters passed in as the arguments.
  1420. </entry>
  1421. </row>
  1422. <row>
  1423. <entry>
  1424. <code>Zend_Ldap_Filter_Abstract
  1425. addOr(Zend_Ldap_Filter_Abstract $filter,...)</code>
  1426. </entry>
  1427. <entry>
  1428. Creates an 'or' filter from the current filter and all
  1429. filters passed in as the arguments.
  1430. </entry>
  1431. </row>
  1432. <row>
  1433. <entry>
  1434. <emphasis> <code>string|array escapeValue(string|array
  1435. $values)</code> </emphasis>
  1436. </entry>
  1437. <entry>
  1438. Escapes the given <code>$values</code> according to RFC 2254
  1439. so that they can be safely used in LDAP filters. If a single string
  1440. is given, a string is returned - otherwise an array is returned.
  1441. Any control characters with an ACII code &lt; 32 as well as the
  1442. characters with special meaning in LDAP filters "*", "(", ")", and
  1443. "\" (the backslash) are converted into the representation of a
  1444. backslash followed by two hex digits representing the hexadecimal
  1445. value of the character.
  1446. </entry>
  1447. </row>
  1448. <row>
  1449. <entry>
  1450. <emphasis> <code>string|array unescapeValue(string|array
  1451. $values)</code> </emphasis>
  1452. </entry>
  1453. <entry>
  1454. Undoes the conversion done by
  1455. <code>Zend_Ldap_Filter::escapeValue()</code>. Converts any
  1456. sequences of a backslash followed by two hex digits into the
  1457. corresponding character.
  1458. </entry>
  1459. </row>
  1460. </tbody>
  1461. </tgroup>
  1462. </table>
  1463. </sect3>
  1464. <sect3 id="zend.ldap.api.reference.zend-ldap-node">
  1465. <title>Zend_Ldap_Node</title>
  1466. <para>
  1467. <code>Zend_Ldap_Node</code> includes the magic propery accessors
  1468. <code>__set()</code>, <code>__get()</code>, <code>__unset()</code> and
  1469. <code>__isset()</code> to access the attributes by their name. They proxy to
  1470. <code>Zend_Ldap_Node::setAttribute()</code>,
  1471. <code>Zend_Ldap_Node::getAttribute()</code>,
  1472. <code>Zend_Ldap_Node::deleteAttribute()</code> and
  1473. <code>Zend_Ldap_Node::existsAttribute()</code> respectively. Furthermore the class
  1474. implements <code>ArrayAccess</code> for array-style-access to the attributes.
  1475. <code>Zend_Ldap_Node</code> also implements <code>Iterator</code> and
  1476. <code>RecursiveIterato</code> to allow for recursive tree-traversal.
  1477. </para>
  1478. <table id="zend.ldap.api.reference.zend-ldap-node.table">
  1479. <title>Zend_Ldap_Node API</title>
  1480. <tgroup cols="2">
  1481. <thead>
  1482. <row>
  1483. <entry>Method</entry>
  1484. <entry>Description</entry>
  1485. </row>
  1486. </thead>
  1487. <tbody>
  1488. <row>
  1489. <entry><code>Zend_Ldap getLdap()</code></entry>
  1490. <entry>
  1491. Returns the current LDAP connection. Throws
  1492. <code>Zend_Ldap_Exception</code> if current node is in detached
  1493. mode (not connected to a <code>Zend_Ldap</code> instance).
  1494. </entry>
  1495. </row>
  1496. <row>
  1497. <entry>
  1498. <code>Zend_Ldap_Node attachLdap(Zend_Ldap
  1499. $ldap)</code>
  1500. </entry>
  1501. <entry>
  1502. Attach the current node to the <code>$ldap</code>
  1503. <code>Zend_Ldap</code> instance. Throws
  1504. <code>Zend_Ldap_Exception</code> if <code>$ldap</code> is not
  1505. responsible for the current node (node is not a child of the
  1506. <code>$ldap</code> base DN).
  1507. </entry>
  1508. </row>
  1509. <row>
  1510. <entry><code>Zend_Ldap_Node detachLdap()</code></entry>
  1511. <entry>Detach node from LDAP connection.</entry>
  1512. </row>
  1513. <row>
  1514. <entry><code>boolean isAttached()</code></entry>
  1515. <entry>
  1516. Checks if the current node is attached to a LDAP
  1517. connection.
  1518. </entry>
  1519. </row>
  1520. <row>
  1521. <entry>
  1522. <emphasis> <code>Zend_Ldap_Node
  1523. create(string|array|Zend_Ldap_Dn $dn, array $objectClass)</code>
  1524. </emphasis>
  1525. </entry>
  1526. <entry>
  1527. Factory method to create a new detached
  1528. <code>Zend_Ldap_Node</code> for a given DN. Creates a new
  1529. <code>Zend_Ldap_Node</code> with the DN <code>$dn</code> and the
  1530. object-classes <code>$objectClass</code>.
  1531. </entry>
  1532. </row>
  1533. <row>
  1534. <entry>
  1535. <emphasis> <code>Zend_Ldap_Node
  1536. fromLdap(string|array|Zend_Ldap_Dn $dn, Zend_Ldap $ldap)</code>
  1537. </emphasis>
  1538. </entry>
  1539. <entry>
  1540. Factory method to create an attached
  1541. <code>Zend_Ldap_Node</code> for a given DN. Loads an existing
  1542. <code>Zend_Ldap_Node</code> with the DN <code>$dn</code> from the
  1543. LDAP connection <code>$ldap</code>.
  1544. </entry>
  1545. </row>
  1546. <row>
  1547. <entry>
  1548. <emphasis> <code>Zend_Ldap_Node fromArray((array $data,
  1549. boolean $fromDataSource)</code> </emphasis>
  1550. </entry>
  1551. <entry>
  1552. Factory method to create a detached
  1553. <code>Zend_Ldap_Node</code> from array data <code>$data</code>. If
  1554. <code>$fromDataSource</code> is <code>true</code>
  1555. (<code>false</code> by default), the data is treated as beeing
  1556. present in a LDAP tree.
  1557. </entry>
  1558. </row>
  1559. <row>
  1560. <entry><code>boolean isNew()</code></entry>
  1561. <entry>
  1562. Tells if the node is consiedered as new (not present on the
  1563. server). Please note, that this doesn't tell if the node is really
  1564. present on the server. Use <code>Zend_Ldap_Node::exists()</code> to
  1565. see if a node is already there.
  1566. </entry>
  1567. </row>
  1568. <row>
  1569. <entry><code>boolean willBeDeleted()</code></entry>
  1570. <entry>
  1571. Tells if this node is going to be deleted once
  1572. <code>Zend_Ldap_Node::update()</code> is called.
  1573. </entry>
  1574. </row>
  1575. <row>
  1576. <entry><code>Zend_Ldap_Node delete()</code></entry>
  1577. <entry>
  1578. Marks this node as to be deleted. Node will be deleted on
  1579. calling <code>Zend_Ldap_Node::update()</code> if
  1580. <code>Zend_Ldap_Node::willBeDeleted()</code> is true.
  1581. </entry>
  1582. </row>
  1583. <row>
  1584. <entry><code>boolean willBeMoved()</code></entry>
  1585. <entry>
  1586. Tells if this node is going to be moved once
  1587. <code>Zend_Ldap_Node::update()</code> is called.
  1588. </entry>
  1589. </row>
  1590. <row>
  1591. <entry><code>Zend_Ldap_Node update(Zend_Ldap $ldap)</code></entry>
  1592. <entry>
  1593. Sends all pending changes to the LDAP server. If
  1594. <code>$ldap</code> is omitted the current LDAP connection is used.
  1595. If the current node is detached from a LDAP connection a
  1596. <code>Zend_Ldap_Exception</code> will be thrown. If
  1597. <code>$ldap</code> is provided the current node will be attached to
  1598. the given LDAP connection.
  1599. </entry>
  1600. </row>
  1601. <row>
  1602. <entry><code>Zend_Ldap_Dn getCurrentDn()</code></entry>
  1603. <entry>
  1604. Gets the current DN of the current node as a Zend_Ldap_Dn.
  1605. This does not reflect possible rename-operations.
  1606. </entry>
  1607. </row>
  1608. <row>
  1609. <entry><code>Zend_Ldap_Dn getDn()</code></entry>
  1610. <entry>
  1611. Gets the original DN of the current node as a Zend_Ldap_Dn.
  1612. This reflects possible rename-operations.
  1613. </entry>
  1614. </row>
  1615. <row>
  1616. <entry><code>string getDnString(string $caseFold)</code></entry>
  1617. <entry>
  1618. Gets the original DN of the current node as a string. This
  1619. reflects possible rename-operations.
  1620. </entry>
  1621. </row>
  1622. <row>
  1623. <entry><code>array getDnArray(string $caseFold)</code></entry>
  1624. <entry>
  1625. Gets the original DN of the current node as an array. This
  1626. reflects possible rename-operations.
  1627. </entry>
  1628. </row>
  1629. <row>
  1630. <entry><code>string getRdnString(string $caseFold)</code></entry>
  1631. <entry>
  1632. Gets the RDN of the current node as a string. This reflects
  1633. possible rename-operations.
  1634. </entry>
  1635. </row>
  1636. <row>
  1637. <entry><code>array getRdnArray(string $caseFold)</code></entry>
  1638. <entry>
  1639. Gets the RDN of the current node as an array. This reflects
  1640. possible rename-operations.
  1641. </entry>
  1642. </row>
  1643. <row>
  1644. <entry>
  1645. <code>Zend_Ldap_Node setDn(Zend_Ldap_Dn|string|array
  1646. $newDn)</code>
  1647. </entry>
  1648. <entry>
  1649. Sets the new DN for this node effectively moving the node
  1650. once <code>Zend_Ldap_Node::update()</code> is called.
  1651. </entry>
  1652. </row>
  1653. <row>
  1654. <entry>
  1655. <code>Zend_Ldap_Node move(Zend_Ldap_Dn|string|array
  1656. $newDn)</code>
  1657. </entry>
  1658. <entry>
  1659. This is an alias for
  1660. <code>Zend_Ldap_Node::setDn()</code>.
  1661. </entry>
  1662. </row>
  1663. <row>
  1664. <entry>
  1665. <code>Zend_Ldap_Node rename(Zend_Ldap_Dn|string|array
  1666. $newDn)</code>
  1667. </entry>
  1668. <entry>
  1669. This is an alias for
  1670. <code>Zend_Ldap_Node::setDn()</code>.
  1671. </entry>
  1672. </row>
  1673. <row>
  1674. <entry><code>array getObjectClass()</code></entry>
  1675. <entry>Returns the objectClass of the node.</entry>
  1676. </row>
  1677. <row>
  1678. <entry>
  1679. <code>Zend_Ldap_Node setObjectClass(array|string
  1680. $value)</code>
  1681. </entry>
  1682. <entry>Sets the objectClass attribute.</entry>
  1683. </row>
  1684. <row>
  1685. <entry>
  1686. <code>Zend_Ldap_Node appendObjectClass(array|string
  1687. $value)</code>
  1688. </entry>
  1689. <entry>Appends to the objectClass attribute.</entry>
  1690. </row>
  1691. <row>
  1692. <entry><code>string toLdif(array $options)</code></entry>
  1693. <entry>
  1694. Returns a LDIF representation of the current node.
  1695. <code>$options</code> will be passed to the
  1696. <code>Zend_Ldap_Ldif_Encoder</code>.
  1697. </entry>
  1698. </row>
  1699. <row>
  1700. <entry><code>array getChangedData()</code></entry>
  1701. <entry>
  1702. Gets changed node data. The array contains all changed
  1703. attributes. This format can be used in
  1704. <code>Zend_Ldap::add()</code> and
  1705. <code>Zend_Ldap::update()</code>.
  1706. </entry>
  1707. </row>
  1708. <row>
  1709. <entry><code>array getChanges()</code></entry>
  1710. <entry>Returns all changes made.</entry>
  1711. </row>
  1712. <row>
  1713. <entry><code>string toString()</code></entry>
  1714. <entry>
  1715. Returns the DN of the current node - proxies to
  1716. <code>Zend_Ldap_Dn::getDnString()</code>.
  1717. </entry>
  1718. </row>
  1719. <row>
  1720. <entry><code>string __toString()</code></entry>
  1721. <entry>
  1722. Casts to string representation - proxies to
  1723. <code>Zend_Ldap_Dn::toString()</code>.
  1724. </entry>
  1725. </row>
  1726. <row>
  1727. <entry>
  1728. <code>array toArray(boolean
  1729. $includeSystemAttributes)</code>
  1730. </entry>
  1731. <entry>
  1732. Returns an array representation of the current node. If
  1733. <code>$includeSystemAttributes</code> is <code>false</code>
  1734. (defaults to <code>true</code>) the system specific attributes are
  1735. stripped from the array. Unlike
  1736. <code>Zend_Ldap_Node::getAttributes()</code> the resulting array
  1737. contains the DN with key <code>'dn'</code>.
  1738. </entry>
  1739. </row>
  1740. <row>
  1741. <entry>
  1742. <code>string toJson(boolean
  1743. $includeSystemAttributes)</code>
  1744. </entry>
  1745. <entry>
  1746. Returns a JSON representation of the current node using
  1747. <code>Zend_Ldap_Node::toArray()</code>.
  1748. </entry>
  1749. </row>
  1750. <row>
  1751. <entry>
  1752. <code>array getData(boolean
  1753. $includeSystemAttributes)</code>
  1754. </entry>
  1755. <entry>
  1756. Returns the node's attributes. The array contains all
  1757. attributes in its internal format (no conversion).
  1758. </entry>
  1759. </row>
  1760. <row>
  1761. <entry>
  1762. <code>boolean existsAttribute(string $name, boolean
  1763. $emptyExists)</code>
  1764. </entry>
  1765. <entry>
  1766. Checks whether a given attribute exists. If
  1767. <code>$emptyExists</code> is <code>false</code> empty attributes
  1768. (containing only array()) are treated as non-existent returning
  1769. <code>false</code>. If <code>$emptyExists</code> is true empty
  1770. attributes are treated as existent returning <code>true</code>. In
  1771. this case teh method returns <code>false</code> only if the
  1772. attribute name is missing in the key-collection.
  1773. </entry>
  1774. </row>
  1775. <row>
  1776. <entry>
  1777. <code>boolean attributeHasValue(string $name, mixed|array
  1778. $value)</code>
  1779. </entry>
  1780. <entry>
  1781. Checks if the given value(s) exist in the attribute. The
  1782. method returns <code>true</code> only if all values in
  1783. <code>$value</code> are present in the attribute. Comparison is
  1784. done strictly (respecting the data type).
  1785. </entry>
  1786. </row>
  1787. <row>
  1788. <entry><code>integer count()</code></entry>
  1789. <entry>
  1790. Returns the number of attributes in the node. Implements
  1791. Countable.
  1792. </entry>
  1793. </row>
  1794. <row>
  1795. <entry>
  1796. <code>mixed getAttribute(string $name, integer|null
  1797. $index)</code>
  1798. </entry>
  1799. <entry>
  1800. Gets a LDAP attribute. Data conversion is applied using
  1801. <code>Zend_Ldap_Attribute::getAttribute()</code>.
  1802. </entry>
  1803. </row>
  1804. <row>
  1805. <entry>
  1806. <code>array getAttributes(boolean
  1807. $includeSystemAttributes)</code>
  1808. </entry>
  1809. <entry>
  1810. Gets all attributes of node. If
  1811. <code>$includeSystemAttributes</code> is <code>false</code>
  1812. (defaults to <code>true</code>) the system specific attributes are
  1813. stripped from the array.
  1814. </entry>
  1815. </row>
  1816. <row>
  1817. <entry>
  1818. <code>Zend_Ldap_Node setAttribute(string $name, mixed
  1819. $value)</code>
  1820. </entry>
  1821. <entry>
  1822. Sets a LDAP attribute. Data conversion is applied using
  1823. <code>Zend_Ldap_Attribute::setAttribute()</code>.
  1824. </entry>
  1825. </row>
  1826. <row>
  1827. <entry>
  1828. <code>Zend_Ldap_Node appendToAttribute(string $name, mixed
  1829. $value)</code>
  1830. </entry>
  1831. <entry>
  1832. Appends to a LDAP attribute. Data conversion is applied
  1833. using <code>Zend_Ldap_Attribute::setAttribute()</code>.
  1834. </entry>
  1835. </row>
  1836. <row>
  1837. <entry>
  1838. <code>array|integer getDateTimeAttribute(string $name,
  1839. integer|null $index)</code>
  1840. </entry>
  1841. <entry>
  1842. Gets a LDAP date/time attribute. Data conversion is applied
  1843. using
  1844. <code>Zend_Ldap_Attribute::getDateTimeAttribute()</code>.
  1845. </entry>
  1846. </row>
  1847. <row>
  1848. <entry>
  1849. <code>Zend_Ldap_Node setDateTimeAttribute(string $name,
  1850. integer|array $value, boolean $utc)</code>
  1851. </entry>
  1852. <entry>
  1853. Sets a LDAP date/time attribute. Data conversion is applied
  1854. using
  1855. <code>Zend_Ldap_Attribute::setDateTimeAttribute()</code>.
  1856. </entry>
  1857. </row>
  1858. <row>
  1859. <entry>
  1860. <code>Zend_Ldap_Node appendToDateTimeAttribute(string $name,
  1861. integer|array $value, boolean $utc)</code>
  1862. </entry>
  1863. <entry>
  1864. Appends to a LDAP date/time attribute. Data conversion is
  1865. applied using
  1866. <code>Zend_Ldap_Attribute::setDateTimeAttribute()</code>.
  1867. </entry>
  1868. </row>
  1869. <row>
  1870. <entry>
  1871. <code>Zend_Ldap_Node setPasswordAttribute(string $password,
  1872. string $hashType, string $attribName)</code>
  1873. </entry>
  1874. <entry>
  1875. Sets a LDAP password on <code>$attribName</code> (defaults
  1876. to <code>'userPassword'</code>) to <code>$password</code> with the
  1877. hash type <code>$hashType</code> (defaults to
  1878. <code>Zend_Ldap_Attribute::PASSWORD_HASH_MD5</code>).
  1879. </entry>
  1880. </row>
  1881. <row>
  1882. <entry>
  1883. <code>Zend_Ldap_Node deleteAttribute(string
  1884. $name)</code>
  1885. </entry>
  1886. <entry>Deletes a LDAP attribute.</entry>
  1887. </row>
  1888. <row>
  1889. <entry>
  1890. <code>void removeDuplicatesFromAttribute(string
  1891. $name)</code>
  1892. </entry>
  1893. <entry>Removes duplicate values from a LDAP attribute.</entry>
  1894. </row>
  1895. <row>
  1896. <entry>
  1897. <code>void removeFromAttribute(string $attribName,
  1898. mixed|array $value)</code>
  1899. </entry>
  1900. <entry>Removes the given values from a LDAP attribute.</entry>
  1901. </row>
  1902. <row>
  1903. <entry><code>boolean exists(Zend_Ldap $ldap)</code></entry>
  1904. <entry>
  1905. Checks if the current node exists on the given LDAP server
  1906. (current server is used if <code>null</code> is passed).
  1907. </entry>
  1908. </row>
  1909. <row>
  1910. <entry><code>Zend_Ldap_Node reload(Zend_Ldap $ldap)</code></entry>
  1911. <entry>
  1912. Reloads the current node's attributes from the given LDAP
  1913. server (current server is used if <code>null</code> is
  1914. passed).
  1915. </entry>
  1916. </row>
  1917. <row>
  1918. <entry>
  1919. <code>Zend_Ldap_Node_Collection
  1920. searchSubtree(string|Zend_Ldap_Filter_Abstract $filter, integer
  1921. $scope, string $sort)</code>
  1922. </entry>
  1923. <entry>
  1924. Searches the nodes's subtree with the given
  1925. <code>$filter</code> and the given search parameters. See
  1926. <code>Zend_Ldap::search()</code> for details on the parameters
  1927. <code>$scope</code> and <code>$sort</code>.
  1928. </entry>
  1929. </row>
  1930. <row>
  1931. <entry>
  1932. <code>integer countSubtree(string|Zend_Ldap_Filter_Abstract
  1933. $filter, integer $scope)</code>
  1934. </entry>
  1935. <entry>
  1936. Count the nodes's subtree items matching the the given
  1937. <code>$filter</code> and the given search scope. See
  1938. <code>Zend_Ldap::search()</code> for details on the
  1939. <code>$scope</code> parameter.
  1940. </entry>
  1941. </row>
  1942. <row>
  1943. <entry><code>integer countChildren()</code></entry>
  1944. <entry>Count the nodes's children.</entry>
  1945. </row>
  1946. <row>
  1947. <entry>
  1948. <code>Zend_Ldap_Node_Collection
  1949. searchChildren(string|Zend_Ldap_Filter_Abstract $filter, string
  1950. $sort)</code>
  1951. </entry>
  1952. <entry>
  1953. Searches the nodes's children matching the given
  1954. <code>$filter</code>. See <code>Zend_Ldap::search()</code> for
  1955. details on the <code>$sort</code> parameter.
  1956. </entry>
  1957. </row>
  1958. <row>
  1959. <entry><code>boolean hasChildren()</code></entry>
  1960. <entry>Returns whether the current node has children.</entry>
  1961. </row>
  1962. <row>
  1963. <entry>
  1964. <code>Zend_Ldap_Node_ChildrenIterator
  1965. getChildren()</code>
  1966. </entry>
  1967. <entry>Returns all children of the current node.</entry>
  1968. </row>
  1969. <row>
  1970. <entry>
  1971. <code>Zend_Ldap_Node getParent(Zend_Ldap
  1972. $ldap)</code>
  1973. </entry>
  1974. <entry>
  1975. Returns the parent of the current node using the LDAP
  1976. connection <code>$ldap</code> (uses the current LDAP connection if
  1977. omitted).
  1978. </entry>
  1979. </row>
  1980. </tbody>
  1981. </tgroup>
  1982. </table>
  1983. </sect3>
  1984. <sect3 id="zend.ldap.api.reference.zend-ldap-node-rootdse">
  1985. <title>Zend_Ldap_Node_RootDse</title>
  1986. <para>The following methods are available on all vendor-specific subclasses.</para>
  1987. <para>
  1988. <code>Zend_Ldap_Node_RootDse</code> includes the magic propery accessors
  1989. <code>__get()</code> and <code>__isset()</code> to access the attributes by their
  1990. name. They proxy to <code>Zend_Ldap_Node_RootDse::getAttribute()</code> and
  1991. <code>Zend_Ldap_Node_RootDse::existsAttribute()</code> respectively.
  1992. <code>__set()</code> and <code>__unset()</code> are also implemented but they throw
  1993. a <code>BadMethodCallException</code> as modifications are not allowed on RootDSE
  1994. nodes. Furthermore the class implements <code>ArrayAccess</code> for
  1995. array-style-access to the attributes. <code>offsetSet()</code> and
  1996. <code>offsetUnset()</code> also throw a <code>BadMethodCallException</code> due ro
  1997. obvious reasons.
  1998. </para>
  1999. <table id="zend.ldap.api.reference.zend-ldap-node-rootdse.table">
  2000. <title>Zend_Ldap_Node_RootDse API</title>
  2001. <tgroup cols="2">
  2002. <thead>
  2003. <row>
  2004. <entry>Method</entry>
  2005. <entry>Description</entry>
  2006. </row>
  2007. </thead>
  2008. <tbody>
  2009. <row>
  2010. <entry><code>Zend_Ldap_Dn getDn()</code></entry>
  2011. <entry>Gets the DN of the current node as a Zend_Ldap_Dn.</entry>
  2012. </row>
  2013. <row>
  2014. <entry><code>string getDnString(string $caseFold)</code></entry>
  2015. <entry>Gets the DN of the current node as a string.</entry>
  2016. </row>
  2017. <row>
  2018. <entry><code>array getDnArray(string $caseFold)</code></entry>
  2019. <entry>Gets the DN of the current node as an array.</entry>
  2020. </row>
  2021. <row>
  2022. <entry><code>string getRdnString(string $caseFold)</code></entry>
  2023. <entry>Gets the RDN of the current node as a string.</entry>
  2024. </row>
  2025. <row>
  2026. <entry><code>array getRdnArray(string $caseFold)</code></entry>
  2027. <entry>Gets the RDN of the current node as an array.</entry>
  2028. </row>
  2029. <row>
  2030. <entry><code>array getObjectClass()</code></entry>
  2031. <entry>Returns the objectClass of the node.</entry>
  2032. </row>
  2033. <row>
  2034. <entry><code>string toString()</code></entry>
  2035. <entry>
  2036. Returns the DN of the current node - proxies to
  2037. <code>Zend_Ldap_Dn::getDnString()</code>.
  2038. </entry>
  2039. </row>
  2040. <row>
  2041. <entry><code>string __toString()</code></entry>
  2042. <entry>
  2043. Casts to string representation - proxies to
  2044. <code>Zend_Ldap_Dn::toString()</code>.
  2045. </entry>
  2046. </row>
  2047. <row>
  2048. <entry>
  2049. <code>array toArray(boolean
  2050. $includeSystemAttributes)</code>
  2051. </entry>
  2052. <entry>
  2053. Returns an array representation of the current node. If
  2054. <code>$includeSystemAttributes</code> is <code>false</code>
  2055. (defaults to <code>true</code>) the system specific attributes are
  2056. stripped from the array. Unlike
  2057. <code>Zend_Ldap_Node_RootDse::getAttributes()</code> the resulting
  2058. array contains the DN with key <code>'dn'</code>.
  2059. </entry>
  2060. </row>
  2061. <row>
  2062. <entry>
  2063. <code>string toJson(boolean
  2064. $includeSystemAttributes)</code>
  2065. </entry>
  2066. <entry>
  2067. Returns a JSON representation of the current node using
  2068. <code>Zend_Ldap_Node_RootDse::toArray()</code>.
  2069. </entry>
  2070. </row>
  2071. <row>
  2072. <entry>
  2073. <code>array getData(boolean
  2074. $includeSystemAttributes)</code>
  2075. </entry>
  2076. <entry>
  2077. Returns the node's attributes. The array contains all
  2078. attributes in its internal format (no conversion).
  2079. </entry>
  2080. </row>
  2081. <row>
  2082. <entry>
  2083. <code>boolean existsAttribute(string $name, boolean
  2084. $emptyExists)</code>
  2085. </entry>
  2086. <entry>
  2087. Checks whether a given attribute exists. If
  2088. <code>$emptyExists</code> is <code>false</code> empty attributes
  2089. (containing only array()) are treated as non-existent returning
  2090. <code>false</code>. If <code>$emptyExists</code> is true empty
  2091. attributes are treated as existent returning <code>true</code>. In
  2092. this case teh method returns <code>false</code> only if the
  2093. attribute name is missing in the key-collection.
  2094. </entry>
  2095. </row>
  2096. <row>
  2097. <entry>
  2098. <code>boolean attributeHasValue(string $name, mixed|array
  2099. $value)</code>
  2100. </entry>
  2101. <entry>
  2102. Checks if the given value(s) exist in the attribute. The
  2103. method returns <code>true</code> only if all values in
  2104. <code>$value</code> are present in the attribute. Comparison is
  2105. done strictly (respecting the data type).
  2106. </entry>
  2107. </row>
  2108. <row>
  2109. <entry><code>integer count()</code></entry>
  2110. <entry>
  2111. Returns the number of attributes in the node. Implements
  2112. Countable.
  2113. </entry>
  2114. </row>
  2115. <row>
  2116. <entry>
  2117. <code>mixed getAttribute(string $name, integer|null
  2118. $index)</code>
  2119. </entry>
  2120. <entry>
  2121. Gets a LDAP attribute. Data conversion is applied using
  2122. <code>Zend_Ldap_Attribute::getAttribute()</code>.
  2123. </entry>
  2124. </row>
  2125. <row>
  2126. <entry>
  2127. <code>array getAttributes(boolean
  2128. $includeSystemAttributes)</code>
  2129. </entry>
  2130. <entry>
  2131. Gets all attributes of node. If
  2132. <code>$includeSystemAttributes</code> is <code>false</code>
  2133. (defaults to <code>true</code>) the system specific attributes are
  2134. stripped from the array.
  2135. </entry>
  2136. </row>
  2137. <row>
  2138. <entry>
  2139. <code>array|integer getDateTimeAttribute(string $name,
  2140. integer|null $index)</code>
  2141. </entry>
  2142. <entry>
  2143. Gets a LDAP date/time attribute. Data conversion is applied
  2144. using
  2145. <code>Zend_Ldap_Attribute::getDateTimeAttribute()</code>.
  2146. </entry>
  2147. </row>
  2148. <row>
  2149. <entry>
  2150. <code>Zend_Ldap_Node_RootDse reload(Zend_Ldap
  2151. $ldap)</code>
  2152. </entry>
  2153. <entry>
  2154. Reloads the current node's attributes from the given LDAP
  2155. server.
  2156. </entry>
  2157. </row>
  2158. <row>
  2159. <entry>
  2160. <emphasis> <code>Zend_Ldap_Node_RootDse create(Zend_Ldap
  2161. $ldap)</code> </emphasis>
  2162. </entry>
  2163. <entry>Factory method to create the RootDSE.</entry>
  2164. </row>
  2165. <row>
  2166. <entry><code>array getNamingContexts()</code></entry>
  2167. <entry>Gets the namingContexts.</entry>
  2168. </row>
  2169. <row>
  2170. <entry><code>string|null getSubschemaSubentry()</code></entry>
  2171. <entry>Gets the subschemaSubentry.</entry>
  2172. </row>
  2173. <row>
  2174. <entry>
  2175. <code>boolean supportsVersion(string|int|array
  2176. $versions)</code>
  2177. </entry>
  2178. <entry>Determines if the LDAP version is supported.</entry>
  2179. </row>
  2180. <row>
  2181. <entry>
  2182. <code>boolean supportsSaslMechanism(string|array
  2183. $mechlist)</code>
  2184. </entry>
  2185. <entry>Determines if the sasl mechanism is supported.</entry>
  2186. </row>
  2187. <row>
  2188. <entry><code>integer getServerType()</code></entry>
  2189. <entry>
  2190. Gets the server type. Returns
  2191. <variablelist>
  2192. <varlistentry>
  2193. <term>
  2194. <code>Zend_Ldap_Node_RootDse::SERVER_TYPE_GENERIC</code></term>
  2195. <listitem>for unknown LDAP servers</listitem>
  2196. </varlistentry>
  2197. <varlistentry>
  2198. <term>
  2199. <code>Zend_Ldap_Node_RootDse::SERVER_TYPE_OPENLDAP</code></term>
  2200. <listitem>for OpenLDAP servers</listitem>
  2201. </varlistentry>
  2202. <varlistentry>
  2203. <term>
  2204. <code>Zend_Ldap_Node_RootDse::SERVER_TYPE_ACTIVEDIRECTORY</code></term>
  2205. <listitem>for Microsoft ActiveDirectory servers</listitem>
  2206. </varlistentry>
  2207. <varlistentry>
  2208. <term>
  2209. <code>Zend_Ldap_Node_RootDse::SERVER_TYPE_EDIRECTORY</code></term>
  2210. <listitem>For Novell eDirectory servers</listitem>
  2211. </varlistentry>
  2212. </variablelist>
  2213. </entry>
  2214. </row>
  2215. <row>
  2216. <entry><code>Zend_Ldap_Dn getSchemaDn()</code></entry>
  2217. <entry>Returns the schema DN.</entry>
  2218. </row>
  2219. </tbody>
  2220. </tgroup>
  2221. </table>
  2222. <sect4 id="zend.ldap.api.reference.zend-ldap-node-rootdse.openldap">
  2223. <title>OpenLDAP</title>
  2224. <para>
  2225. Additionally the common methods above apply to instances of
  2226. <code>Zend_Ldap_Node_RootDse_OpenLdap</code>.
  2227. </para>
  2228. <note>
  2229. <para>
  2230. Refer to
  2231. <ulink url="http://www.zytrax.com/books/ldap/ch3/#operational">LDAP
  2232. Operational Attributes and Objects</ulink>for information on the attributes
  2233. of OpenLDAP RootDSE.
  2234. </para>
  2235. </note>
  2236. <table id="zend.ldap.api.reference.zend-ldap-node-rootdse.openldap.table">
  2237. <title>Zend_Ldap_Node_RootDse_OpenLdap API</title>
  2238. <tgroup cols="2">
  2239. <thead>
  2240. <row>
  2241. <entry>Method</entry>
  2242. <entry>Description</entry>
  2243. </row>
  2244. </thead>
  2245. <tbody>
  2246. <row>
  2247. <entry><code>integer getServerType()</code></entry>
  2248. <entry>
  2249. Gets the server type. Returns
  2250. <code>Zend_Ldap_Node_RootDse::SERVER_TYPE_OPENLDAP</code>
  2251. </entry>
  2252. </row>
  2253. <row>
  2254. <entry><code>string|null getConfigContext()</code></entry>
  2255. <entry>Gets the configContext.</entry>
  2256. </row>
  2257. <row>
  2258. <entry><code>string|null getMonitorContext()</code></entry>
  2259. <entry>Gets the monitorContext.</entry>
  2260. </row>
  2261. <row>
  2262. <entry>
  2263. <code>boolean supportsControl(string|array
  2264. $oids)</code>
  2265. </entry>
  2266. <entry>Determines if the control is supported.</entry>
  2267. </row>
  2268. <row>
  2269. <entry>
  2270. <code>boolean supportsExtension(string|array
  2271. $oids)</code>
  2272. </entry>
  2273. <entry>Determines if the extension is supported.</entry>
  2274. </row>
  2275. <row>
  2276. <entry>
  2277. <code>boolean supportsFeature(string|array
  2278. $oids)</code>
  2279. </entry>
  2280. <entry>Determines if the feature is supported.</entry>
  2281. </row>
  2282. </tbody>
  2283. </tgroup>
  2284. </table>
  2285. </sect4>
  2286. <sect4 id="zend.ldap.api.reference.zend-ldap-node-rootdse.activedirectory">
  2287. <title>ActiveDirectory</title>
  2288. <para>
  2289. Additionally the common methods above apply to instances of
  2290. <code>Zend_Ldap_Node_RootDse_ActiveDirectory</code>.
  2291. </para>
  2292. <note>
  2293. <para>
  2294. Refer to
  2295. <ulink url="http://msdn.microsoft.com/en-us/library/ms684291(VS.85).aspx">
  2296. RootDSE</ulink>for information on the attributes of Microsoft
  2297. ActiveDirectory RootDSE.
  2298. </para>
  2299. </note>
  2300. <table id="zend.ldap.api.reference.zend-ldap-node-rootdse.activedirectory.table">
  2301. <title>Zend_Ldap_Node_RootDse_ActiveDirectory API</title>
  2302. <tgroup cols="2">
  2303. <thead>
  2304. <row>
  2305. <entry>Method</entry>
  2306. <entry>Description</entry>
  2307. </row>
  2308. </thead>
  2309. <tbody>
  2310. <row>
  2311. <entry><code>integer getServerType()</code></entry>
  2312. <entry>
  2313. Gets the server type. Returns
  2314. <code>Zend_Ldap_Node_RootDse::SERVER_TYPE_ACTIVEDIRECTORY</code>
  2315. </entry>
  2316. </row>
  2317. <row>
  2318. <entry>
  2319. <code>string|null
  2320. getConfigurationNamingContext()</code>
  2321. </entry>
  2322. <entry>Gets the configurationNamingContext.</entry>
  2323. </row>
  2324. <row>
  2325. <entry><code>string|null getCurrentTime()</code></entry>
  2326. <entry>Gets the currentTime.</entry>
  2327. </row>
  2328. <row>
  2329. <entry>
  2330. <code>string|null
  2331. getDefaultNamingContext()</code>
  2332. </entry>
  2333. <entry>Gets the defaultNamingContext.</entry>
  2334. </row>
  2335. <row>
  2336. <entry><code>string|null getDnsHostName()</code></entry>
  2337. <entry>Gets the dnsHostName.</entry>
  2338. </row>
  2339. <row>
  2340. <entry>
  2341. <code>string|null
  2342. getDomainControllerFunctionality()</code>
  2343. </entry>
  2344. <entry>Gets the domainControllerFunctionality.</entry>
  2345. </row>
  2346. <row>
  2347. <entry>
  2348. <code>string|null
  2349. getDomainFunctionality()</code>
  2350. </entry>
  2351. <entry>Gets the domainFunctionality.</entry>
  2352. </row>
  2353. <row>
  2354. <entry><code>string|null getDsServiceName()</code></entry>
  2355. <entry>Gets the dsServiceName.</entry>
  2356. </row>
  2357. <row>
  2358. <entry>
  2359. <code>string|null
  2360. getForestFunctionality()</code>
  2361. </entry>
  2362. <entry>Gets the forestFunctionality.</entry>
  2363. </row>
  2364. <row>
  2365. <entry>
  2366. <code>string|null
  2367. getHighestCommittedUSN()</code>
  2368. </entry>
  2369. <entry>Gets the highestCommittedUSN.</entry>
  2370. </row>
  2371. <row>
  2372. <entry>
  2373. <code>string|null
  2374. getIsGlobalCatalogReady()</code>
  2375. </entry>
  2376. <entry>Gets the isGlobalCatalogReady.</entry>
  2377. </row>
  2378. <row>
  2379. <entry><code>string|null getIsSynchronized()</code></entry>
  2380. <entry>Gets the isSynchronized.</entry>
  2381. </row>
  2382. <row>
  2383. <entry><code>string|null getLdapServiceName()</code></entry>
  2384. <entry>Gets the ldapServiceName.</entry>
  2385. </row>
  2386. <row>
  2387. <entry>
  2388. <code>string|null
  2389. getRootDomainNamingContext()</code>
  2390. </entry>
  2391. <entry>Gets the rootDomainNamingContext.</entry>
  2392. </row>
  2393. <row>
  2394. <entry>
  2395. <code>string|null
  2396. getSchemaNamingContext()</code>
  2397. </entry>
  2398. <entry>Gets the schemaNamingContext.</entry>
  2399. </row>
  2400. <row>
  2401. <entry><code>string|null getServerName()</code></entry>
  2402. <entry>Gets the serverName.</entry>
  2403. </row>
  2404. <row>
  2405. <entry>
  2406. <code>boolean supportsCapability(string|array
  2407. $oids)</code>
  2408. </entry>
  2409. <entry>Determines if the capability is supported.</entry>
  2410. </row>
  2411. <row>
  2412. <entry>
  2413. <code>boolean supportsControl(string|array
  2414. $oids)</code>
  2415. </entry>
  2416. <entry>Determines if the control is supported.</entry>
  2417. </row>
  2418. <row>
  2419. <entry>
  2420. <code>boolean supportsPolicy(string|array
  2421. $policies)</code>
  2422. </entry>
  2423. <entry>Determines if the version is supported.</entry>
  2424. </row>
  2425. </tbody>
  2426. </tgroup>
  2427. </table>
  2428. </sect4>
  2429. <sect4 id="zend.ldap.api.reference.zend-ldap-node-rootdse.edirectory">
  2430. <title>eDirectory</title>
  2431. <para>
  2432. Additionally the common methods above apply to instances of
  2433. <code>Zend_Ldap_Node_RootDse_eDirectory</code>.
  2434. </para>
  2435. <note>
  2436. <para>
  2437. Refer to
  2438. <ulink url="http://www.novell.com/documentation/edir88/edir88/index.html?page=/documentation/edir88/edir88/data/ah59jqq.html">
  2439. Getting Information about the LDAP Server</ulink>for information on the
  2440. attributes of Novell eDirectory RootDSE.
  2441. </para>
  2442. </note>
  2443. <table id="zend.ldap.api.reference.zend-ldap-node-rootdse.edirectory.table">
  2444. <title>Zend_Ldap_Node_RootDse_eDirectory API</title>
  2445. <tgroup cols="2">
  2446. <thead>
  2447. <row>
  2448. <entry>Method</entry>
  2449. <entry>Description</entry>
  2450. </row>
  2451. </thead>
  2452. <tbody>
  2453. <row>
  2454. <entry><code>integer getServerType()</code></entry>
  2455. <entry>
  2456. Gets the server type. Returns
  2457. <code>Zend_Ldap_Node_RootDse::SERVER_TYPE_EDIRECTORY</code>
  2458. </entry>
  2459. </row>
  2460. <row>
  2461. <entry>
  2462. <code>boolean supportsExtension(string|array
  2463. $oids)</code>
  2464. </entry>
  2465. <entry>Determines if the extension is supported.</entry>
  2466. </row>
  2467. <row>
  2468. <entry><code>string|null getVendorName()</code></entry>
  2469. <entry>Gets the vendorName.</entry>
  2470. </row>
  2471. <row>
  2472. <entry><code>string|null getVendorVersion()</code></entry>
  2473. <entry>Gets the vendorVersion.</entry>
  2474. </row>
  2475. <row>
  2476. <entry><code>string|null getDsaName()</code></entry>
  2477. <entry>Gets the dsaName.</entry>
  2478. </row>
  2479. <row>
  2480. <entry><code>string|null getStatisticsErrors()</code></entry>
  2481. <entry>Gets the server statistics "errors".</entry>
  2482. </row>
  2483. <row>
  2484. <entry>
  2485. <code>string|null
  2486. getStatisticsSecurityErrors()</code>
  2487. </entry>
  2488. <entry>Gets the server statistics "securityErrors".</entry>
  2489. </row>
  2490. <row>
  2491. <entry>
  2492. <code>string|null
  2493. getStatisticsChainings()</code>
  2494. </entry>
  2495. <entry>Gets the server statistics "chainings".</entry>
  2496. </row>
  2497. <row>
  2498. <entry>
  2499. <code>string|null
  2500. getStatisticsReferralsReturned()</code>
  2501. </entry>
  2502. <entry>Gets the server statistics "referralsReturned".</entry>
  2503. </row>
  2504. <row>
  2505. <entry>
  2506. <code>string|null
  2507. getStatisticsExtendedOps()</code>
  2508. </entry>
  2509. <entry>Gets the server statistics "extendedOps".</entry>
  2510. </row>
  2511. <row>
  2512. <entry>
  2513. <code>string|null
  2514. getStatisticsAbandonOps()</code>
  2515. </entry>
  2516. <entry>Gets the server statistics "abandonOps".</entry>
  2517. </row>
  2518. <row>
  2519. <entry>
  2520. <code>string|null
  2521. getStatisticsWholeSubtreeSearchOps()</code>
  2522. </entry>
  2523. <entry>
  2524. Gets the server statistics
  2525. "wholeSubtreeSearchOps".
  2526. </entry>
  2527. </row>
  2528. </tbody>
  2529. </tgroup>
  2530. </table>
  2531. </sect4>
  2532. </sect3>
  2533. <sect3 id="zend.ldap.api.reference.zend-ldap-node-schema">
  2534. <title>Zend_Ldap_Node_Schema</title>
  2535. <para>The following methods are available on all vendor-specific subclasses.</para>
  2536. <para>
  2537. <code>Zend_Ldap_Node_Schema</code> includes the magic propery accessors
  2538. <code>__get()</code> and <code>__isset()</code> to access the attributes by their
  2539. name. They proxy to <code>Zend_Ldap_Node_Schema::getAttribute()</code> and
  2540. <code>Zend_Ldap_Node_Schema::existsAttribute()</code> respectively.
  2541. <code>__set()</code> and <code>__unset()</code> are also implemented but they throw
  2542. a <code>BadMethodCallException</code> as modifications are not allowed on RootDSE
  2543. nodes. Furthermore the class implements <code>ArrayAccess</code> for
  2544. array-style-access to the attributes. <code>offsetSet()</code> and
  2545. <code>offsetUnset()</code> also throw a <code>BadMethodCallException</code> due ro
  2546. obvious reasons.
  2547. </para>
  2548. <table id="zend.ldap.api.reference.zend-ldap-node-schema.table">
  2549. <title>Zend_Ldap_Node_Schema API</title>
  2550. <tgroup cols="2">
  2551. <thead>
  2552. <row>
  2553. <entry>Method</entry>
  2554. <entry>Description</entry>
  2555. </row>
  2556. </thead>
  2557. <tbody>
  2558. <row>
  2559. <entry><code>Zend_Ldap_Dn getDn()</code></entry>
  2560. <entry>Gets the DN of the current node as a Zend_Ldap_Dn.</entry>
  2561. </row>
  2562. <row>
  2563. <entry><code>string getDnString(string $caseFold)</code></entry>
  2564. <entry>Gets the DN of the current node as a string.</entry>
  2565. </row>
  2566. <row>
  2567. <entry><code>array getDnArray(string $caseFold)</code></entry>
  2568. <entry>Gets the DN of the current node as an array.</entry>
  2569. </row>
  2570. <row>
  2571. <entry><code>string getRdnString(string $caseFold)</code></entry>
  2572. <entry>Gets the RDN of the current node as a string.</entry>
  2573. </row>
  2574. <row>
  2575. <entry><code>array getRdnArray(string $caseFold)</code></entry>
  2576. <entry>Gets the RDN of the current node as an array.</entry>
  2577. </row>
  2578. <row>
  2579. <entry><code>array getObjectClass()</code></entry>
  2580. <entry>Returns the objectClass of the node.</entry>
  2581. </row>
  2582. <row>
  2583. <entry><code>string toString()</code></entry>
  2584. <entry>
  2585. Returns the DN of the current node - proxies to
  2586. <code>Zend_Ldap_Dn::getDnString()</code>.
  2587. </entry>
  2588. </row>
  2589. <row>
  2590. <entry><code>string __toString()</code></entry>
  2591. <entry>
  2592. Casts to string representation - proxies to
  2593. <code>Zend_Ldap_Dn::toString()</code>.
  2594. </entry>
  2595. </row>
  2596. <row>
  2597. <entry>
  2598. <code>array toArray(boolean
  2599. $includeSystemAttributes)</code>
  2600. </entry>
  2601. <entry>
  2602. Returns an array representation of the current node. If
  2603. <code>$includeSystemAttributes</code> is <code>false</code>
  2604. (defaults to <code>true</code>) the system specific attributes are
  2605. stripped from the array. Unlike
  2606. <code>Zend_Ldap_Node_Schema::getAttributes()</code> the resulting
  2607. array contains the DN with key <code>'dn'</code>.
  2608. </entry>
  2609. </row>
  2610. <row>
  2611. <entry>
  2612. <code>string toJson(boolean
  2613. $includeSystemAttributes)</code>
  2614. </entry>
  2615. <entry>
  2616. Returns a JSON representation of the current node using
  2617. <code>Zend_Ldap_Node_Schema::toArray()</code>.
  2618. </entry>
  2619. </row>
  2620. <row>
  2621. <entry>
  2622. <code>array getData(boolean
  2623. $includeSystemAttributes)</code>
  2624. </entry>
  2625. <entry>
  2626. Returns the node's attributes. The array contains all
  2627. attributes in its internal format (no conversion).
  2628. </entry>
  2629. </row>
  2630. <row>
  2631. <entry>
  2632. <code>boolean existsAttribute(string $name, boolean
  2633. $emptyExists)</code>
  2634. </entry>
  2635. <entry>
  2636. Checks whether a given attribute exists. If
  2637. <code>$emptyExists</code> is <code>false</code> empty attributes
  2638. (containing only array()) are treated as non-existent returning
  2639. <code>false</code>. If <code>$emptyExists</code> is true empty
  2640. attributes are treated as existent returning <code>true</code>. In
  2641. this case teh method returns <code>false</code> only if the
  2642. attribute name is missing in the key-collection.
  2643. </entry>
  2644. </row>
  2645. <row>
  2646. <entry>
  2647. <code>boolean attributeHasValue(string $name, mixed|array
  2648. $value)</code>
  2649. </entry>
  2650. <entry>
  2651. Checks if the given value(s) exist in the attribute. The
  2652. method returns <code>true</code> only if all values in
  2653. <code>$value</code> are present in the attribute. Comparison is
  2654. done strictly (respecting the data type).
  2655. </entry>
  2656. </row>
  2657. <row>
  2658. <entry><code>integer count()</code></entry>
  2659. <entry>
  2660. Returns the number of attributes in the node. Implements
  2661. Countable.
  2662. </entry>
  2663. </row>
  2664. <row>
  2665. <entry>
  2666. <code>mixed getAttribute(string $name, integer|null
  2667. $index)</code>
  2668. </entry>
  2669. <entry>
  2670. Gets a LDAP attribute. Data conversion is applied using
  2671. <code>Zend_Ldap_Attribute::getAttribute()</code>.
  2672. </entry>
  2673. </row>
  2674. <row>
  2675. <entry>
  2676. <code>array getAttributes(boolean
  2677. $includeSystemAttributes)</code>
  2678. </entry>
  2679. <entry>
  2680. Gets all attributes of node. If
  2681. <code>$includeSystemAttributes</code> is <code>false</code>
  2682. (defaults to <code>true</code>) the system specific attributes are
  2683. stripped from the array.
  2684. </entry>
  2685. </row>
  2686. <row>
  2687. <entry>
  2688. <code>array|integer getDateTimeAttribute(string $name,
  2689. integer|null $index)</code>
  2690. </entry>
  2691. <entry>
  2692. Gets a LDAP date/time attribute. Data conversion is applied
  2693. using
  2694. <code>Zend_Ldap_Attribute::getDateTimeAttribute()</code>.
  2695. </entry>
  2696. </row>
  2697. <row>
  2698. <entry>
  2699. <code>Zend_Ldap_Node_Schema reload(Zend_Ldap
  2700. $ldap)</code>
  2701. </entry>
  2702. <entry>
  2703. Reloads the current node's attributes from the given LDAP
  2704. server.
  2705. </entry>
  2706. </row>
  2707. <row>
  2708. <entry>
  2709. <emphasis> <code>Zend_Ldap_Node_Schema create(Zend_Ldap
  2710. $ldap)</code> </emphasis>
  2711. </entry>
  2712. <entry>Factory method to create the Schema node.</entry>
  2713. </row>
  2714. <row>
  2715. <entry><code>array getAttributeTypes()</code></entry>
  2716. <entry>Gets the attribute types as an array of <code/>.</entry>
  2717. </row>
  2718. <row>
  2719. <entry><code>array getObjectClasses()</code></entry>
  2720. <entry>
  2721. Gets the object classes as an array of
  2722. <code>Zend_Ldap_Node_Schema_ObjectClass_Interface</code>.
  2723. </entry>
  2724. </row>
  2725. </tbody>
  2726. </tgroup>
  2727. </table>
  2728. <table id="zend.ldap.api.reference.zend-ldap-node-schema.attributetype-interface.table">
  2729. <title>Zend_Ldap_Node_Schema_AttributeType_Interface API</title>
  2730. <tgroup cols="2">
  2731. <thead>
  2732. <row>
  2733. <entry>Method</entry>
  2734. <entry>Description</entry>
  2735. </row>
  2736. </thead>
  2737. <tbody>
  2738. <row>
  2739. <entry><code>string getName()</code></entry>
  2740. <entry>Gets the attribute name.</entry>
  2741. </row>
  2742. <row>
  2743. <entry><code>string getOid()</code></entry>
  2744. <entry>Gets the attribute OID.</entry>
  2745. </row>
  2746. <row>
  2747. <entry><code>string getSyntax()</code></entry>
  2748. <entry>Gets the attribute syntax.</entry>
  2749. </row>
  2750. <row>
  2751. <entry><code>int|null getMaxLength()</code></entry>
  2752. <entry>Gets the attribute maximum length.</entry>
  2753. </row>
  2754. <row>
  2755. <entry><code>boolean isSingleValued()</code></entry>
  2756. <entry>Returns if the attribute is single-valued.</entry>
  2757. </row>
  2758. <row>
  2759. <entry><code>string getDescription()</code></entry>
  2760. <entry>Gets the attribute description</entry>
  2761. </row>
  2762. </tbody>
  2763. </tgroup>
  2764. </table>
  2765. <table id="zend.ldap.api.reference.zend-ldap-node-schema.objectclass-interface.table">
  2766. <title>Zend_Ldap_Node_Schema_ObjectClass_Interface API</title>
  2767. <tgroup cols="2">
  2768. <thead>
  2769. <row>
  2770. <entry>Method</entry>
  2771. <entry>Description</entry>
  2772. </row>
  2773. </thead>
  2774. <tbody>
  2775. <row>
  2776. <entry><code>string getName()</code></entry>
  2777. <entry>Returns the objectClass name.</entry>
  2778. </row>
  2779. <row>
  2780. <entry><code>string getOid()</code></entry>
  2781. <entry>Returns the objectClass OID.</entry>
  2782. </row>
  2783. <row>
  2784. <entry><code>array getMustContain()</code></entry>
  2785. <entry>
  2786. Returns the attributes that this objectClass must
  2787. contain.
  2788. </entry>
  2789. </row>
  2790. <row>
  2791. <entry><code>array getMayContain()</code></entry>
  2792. <entry>
  2793. Returns the attributes that this objectClass may
  2794. contain.
  2795. </entry>
  2796. </row>
  2797. <row>
  2798. <entry><code>string getDescription()</code></entry>
  2799. <entry>Returns the attribute description</entry>
  2800. </row>
  2801. <row>
  2802. <entry><code>integer getType()</code></entry>
  2803. <entry>
  2804. Returns the objectClass type. The method returns one of the
  2805. following values:
  2806. <variablelist>
  2807. <varlistentry>
  2808. <term>
  2809. <code>Zend_Ldap_Node_Schema::OBJECTCLASS_TYPE_UNKNOWN</code></term>
  2810. <listitem>for unknown class types</listitem>
  2811. </varlistentry>
  2812. <varlistentry>
  2813. <term>
  2814. <code>Zend_Ldap_Node_Schema::OBJECTCLASS_TYPE_STRUCTURAL</code></term>
  2815. <listitem>for structural classes</listitem>
  2816. </varlistentry>
  2817. <varlistentry>
  2818. <term>
  2819. <code>Zend_Ldap_Node_Schema::OBJECTCLASS_TYPE_ABSTRACT</code></term>
  2820. <listitem>for abstract classes</listitem>
  2821. </varlistentry>
  2822. <varlistentry>
  2823. <term>
  2824. <code>Zend_Ldap_Node_Schema::OBJECTCLASS_TYPE_AUXILIARY</code></term>
  2825. <listitem>for auxiliary classes</listitem>
  2826. </varlistentry>
  2827. </variablelist>
  2828. </entry>
  2829. </row>
  2830. <row>
  2831. <entry><code>array getParentClasses()</code></entry>
  2832. <entry>
  2833. Returns the parent objectClasses of this class. This
  2834. includes structural, abstract and auxiliary objectClasses.
  2835. </entry>
  2836. </row>
  2837. </tbody>
  2838. </tgroup>
  2839. </table>
  2840. <para>
  2841. Classes representing attribute types and object classes extend
  2842. <code>Zend_Ldap_Node_Schema_Item</code> which provides some core methods to access
  2843. arbitrary attributes on the underlying LDAP node.
  2844. <code>Zend_Ldap_Node_Schema_Item</code> includes the magic propery accessors
  2845. <code>__get()</code> and <code>__isset()</code> to access the attributes by their
  2846. name. Furthermore the class implements <code>ArrayAccess</code> for
  2847. array-style-access to the attributes. <code>offsetSet()</code> and
  2848. <code>offsetUnset()</code> throw a <code>BadMethodCallException</code> as
  2849. modifications are not allowed on schema information nodes.
  2850. </para>
  2851. <table id="zend.ldap.api.reference.zend-ldap-node-schema.schema-item.table">
  2852. <title>Zend_Ldap_Node_Schema_Item API</title>
  2853. <tgroup cols="2">
  2854. <thead>
  2855. <row>
  2856. <entry>Method</entry>
  2857. <entry>Description</entry>
  2858. </row>
  2859. </thead>
  2860. <tbody>
  2861. <row>
  2862. <entry><code>array getData()</code></entry>
  2863. <entry>
  2864. Gets all the underlying data from the schema information
  2865. node.
  2866. </entry>
  2867. </row>
  2868. <row>
  2869. <entry><code>integer count()</code></entry>
  2870. <entry>
  2871. Returns the number of attributes in this schema information
  2872. node. Implements Countable.
  2873. </entry>
  2874. </row>
  2875. </tbody>
  2876. </tgroup>
  2877. </table>
  2878. <sect4 id="zend.ldap.api.reference.zend-ldap-node-schema.openldap">
  2879. <title>OpenLDAP</title>
  2880. <para>
  2881. Additionally the common methods above apply to instances of
  2882. <code>Zend_Ldap_Node_Schema_OpenLDAP</code>.
  2883. </para>
  2884. <table id="zend.ldap.api.reference.zend-ldap-node-schema.openldap.table">
  2885. <title>Zend_Ldap_Node_Schema_OpenLDAP API</title>
  2886. <tgroup cols="2">
  2887. <thead>
  2888. <row>
  2889. <entry>Method</entry>
  2890. <entry>Description</entry>
  2891. </row>
  2892. </thead>
  2893. <tbody>
  2894. <row>
  2895. <entry><code>array getLdapSyntaxes()</code></entry>
  2896. <entry>Gets the LDAP syntaxes.</entry>
  2897. </row>
  2898. <row>
  2899. <entry><code>array getMatchingRules()</code></entry>
  2900. <entry>Gets the matching rules.</entry>
  2901. </row>
  2902. <row>
  2903. <entry><code>array getMatchingRuleUse()</code></entry>
  2904. <entry>Gets the matching rule use.</entry>
  2905. </row>
  2906. </tbody>
  2907. </tgroup>
  2908. </table>
  2909. <table
  2910. id="zend.ldap.api.reference.zend-ldap-node-schema.openldap.attributetype-interface.table">
  2911. <title>Zend_Ldap_Node_Schema_AttributeType_OpenLDAP API</title>
  2912. <tgroup cols="2">
  2913. <thead>
  2914. <row>
  2915. <entry>Method</entry>
  2916. <entry>Description</entry>
  2917. </row>
  2918. </thead>
  2919. <tbody>
  2920. <row>
  2921. <entry>
  2922. <code>Zend_Ldap_Node_Schema_AttributeType_OpenLdap|null
  2923. getParent()</code>
  2924. </entry>
  2925. <entry>
  2926. Returns the parent attribute type in the inhertitance
  2927. tree if one exists.
  2928. </entry>
  2929. </row>
  2930. </tbody>
  2931. </tgroup>
  2932. </table>
  2933. <table
  2934. id="zend.ldap.api.reference.zend-ldap-node-schema.openldap.objectclass-interface.table">
  2935. <title>Zend_Ldap_Node_Schema_ObjectClass_OpenLDAP API</title>
  2936. <tgroup cols="2">
  2937. <thead>
  2938. <row>
  2939. <entry>Method</entry>
  2940. <entry>Description</entry>
  2941. </row>
  2942. </thead>
  2943. <tbody>
  2944. <row>
  2945. <entry><code>array getParents()</code></entry>
  2946. <entry>
  2947. Returns the parent object classes in the inhertitance
  2948. tree if one exists. The returned array is an array of
  2949. <code>Zend_Ldap_Node_Schema_ObjectClass_OpenLdap</code>.
  2950. </entry>
  2951. </row>
  2952. </tbody>
  2953. </tgroup>
  2954. </table>
  2955. </sect4>
  2956. <sect4 id="zend.ldap.api.reference.zend-ldap-node-schema.activedirectory">
  2957. <title>ActiveDirectory</title>
  2958. <note>
  2959. <title>Schema browsing on ActiveDirectory servers</title>
  2960. <para>
  2961. Due to restrictions on Microsoft ActiveDirectory servers regarding
  2962. the number of entries returned by generic search routines and due to the
  2963. structure of the ActiveDirectory schema repository, schema browsing is
  2964. currently <emphasis>not</emphasis> available for Microsoft ActiveDirectory
  2965. servers.
  2966. </para>
  2967. </note>
  2968. <para>
  2969. <code>Zend_Ldap_Node_Schema_ActiveDirectory</code> does not provide any
  2970. additional methods.
  2971. </para>
  2972. <table
  2973. id="zend.ldap.api.reference.zend-ldap-node-schema.activedirectory.attributetype-interface.table">
  2974. <title>Zend_Ldap_Node_Schema_AttributeType_ActiveDirectory API</title>
  2975. <tgroup cols="1">
  2976. <tbody>
  2977. <row>
  2978. <entry>
  2979. <code>Zend_Ldap_Node_Schema_AttributeType_ActiveDirectory</code>
  2980. does not provide any additional methods.
  2981. </entry>
  2982. </row>
  2983. </tbody>
  2984. </tgroup>
  2985. </table>
  2986. <table
  2987. id="zend.ldap.api.reference.zend-ldap-node-schema.activedirectory.objectclass-interface.table">
  2988. <title>Zend_Ldap_Node_Schema_ObjectClass_ActiveDirectory API</title>
  2989. <tgroup cols="1">
  2990. <tbody>
  2991. <row>
  2992. <entry>
  2993. <code>Zend_Ldap_Node_Schema_ObjectClass_ActiveDirectory</code>
  2994. does not provide any additional methods.
  2995. </entry>
  2996. </row>
  2997. </tbody>
  2998. </tgroup>
  2999. </table>
  3000. </sect4>
  3001. </sect3>
  3002. <sect3 id="zend.ldap.api.reference.zend-ldap-ldif-encoder">
  3003. <title>Zend_Ldif_Encoder</title>
  3004. <table id="zend.ldap.api.reference.zend-ldap-ldif-encoder.table">
  3005. <title>Zend_Ldif_Encoder API</title>
  3006. <tgroup cols="2">
  3007. <thead>
  3008. <row>
  3009. <entry>Method</entry>
  3010. <entry>Description</entry>
  3011. </row>
  3012. </thead>
  3013. <tbody>
  3014. <row>
  3015. <entry>
  3016. <emphasis> <code>array decode(string $string)</code>
  3017. </emphasis>
  3018. </entry>
  3019. <entry>
  3020. Decodes the string <code>$string</code> into an array of
  3021. LDIF items.
  3022. </entry>
  3023. </row>
  3024. <row>
  3025. <entry>
  3026. <emphasis> <code>string encode(scalar|array|Zend_Ldap_Node
  3027. $value, array $options)</code> </emphasis>
  3028. </entry>
  3029. <entry>
  3030. Encode <code>$value</code> into a LDIF representation.
  3031. <code>$options</code> is an array that may contain the following
  3032. keys:
  3033. <variablelist>
  3034. <varlistentry>
  3035. <term><code>'sort'</code></term>
  3036. <listitem>Sort the given attributes with <code>dn</code>
  3037. following <code>objectClass</code> and following all other
  3038. attributes sorted alphabetically. <code>true</code> by
  3039. default.</listitem>
  3040. </varlistentry>
  3041. <varlistentry>
  3042. <term><code>'version'</code></term>
  3043. <listitem>The LDIF format version. <code>1</code> by
  3044. default.</listitem>
  3045. </varlistentry>
  3046. <varlistentry>
  3047. <term><code>'wrap'</code></term>
  3048. <listitem>The line-length. <code>78</code> by default to
  3049. conform to the LDIF specification.</listitem>
  3050. </varlistentry>
  3051. </variablelist>
  3052. </entry>
  3053. </row>
  3054. </tbody>
  3055. </tgroup>
  3056. </table>
  3057. </sect3>
  3058. </sect2>
  3059. </sect1>