cvs: phpdoc /en/reference/spl/arrayobject append.xml construct.xml count.xml offsetexists.xml offsetget.xml offsetset.xml offsetunset.xml
| From: | Juliette | Date: | Wed, 01 Jul 2009 13:29:56 +0000 |
| Subject: | cvs: phpdoc /en/reference/spl/arrayobject append.xml construct.xml count.xml offsetexists.xml offsetget.xml offsetset.xml offsetunset.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-4304@lists.php.net to get a copy of this message | ||
juxecl Wed Jul 1 13:29:56 2009 UTC
Modified files:
/phpdoc/en/reference/spl/arrayobject offsetexists.xml count.xml
offsetunset.xml construct.xml
offsetset.xml offsetget.xml
append.xml
Log:
Update ArrayObject skeleton docs
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/arrayobject/offsetexists.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/spl/arrayobject/offsetexists.xml diff -u phpdoc/en/reference/spl/arrayobject/offsetexists.xml:1.4 phpdoc/en/reference/spl/arrayobject/offsetexists.xml:1.5 --- phpdoc/en/reference/spl/arrayobject/offsetexists.xml:1.4 Thu Mar 20 01:25:03 2008 +++ phpdoc/en/reference/spl/arrayobject/offsetexists.xml Wed Jul 1 13:29:56 2009 @@ -1,9 +1,9 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry xml:id="arrayobject.offsetexists" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>ArrayObject::offsetExists</refname> - <refpurpose>Returns whether the requested $index exists</refpurpose> + <refpurpose>Returns whether the requested index exists</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; @@ -11,8 +11,6 @@ <type>bool</type><methodname>ArrayObject::offsetExists</methodname> <methodparam><type>mixed</type><parameter>index</parameter></methodparam> </methodsynopsis> - - &warn.undocumented.func; </refsect1> <refsect1 role="parameters"> @@ -34,7 +32,34 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - &true; if the requested $index exists, otherwise &false; + &true; if the requested index exists, otherwise &false; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><methodname>ArrayObject::offsetexists</methodname> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +$arrayobj = new ArrayObject(array('zero', 'one', 'example'=>'e.g.')); +var_dump($arrayobj->offsetexists(1)); +var_dump($arrayobj->offsetexists('example')); +var_dump($arrayobj->offsetexists('notfound')); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +bool(true) +bool(true) +bool(false) +]]> + </screen> + </example> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/arrayobject/count.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/spl/arrayobject/count.xml diff -u phpdoc/en/reference/spl/arrayobject/count.xml:1.4 phpdoc/en/reference/spl/arrayobject/count.xml:1.5 --- phpdoc/en/reference/spl/arrayobject/count.xml:1.4 Thu Mar 20 01:25:03 2008 +++ phpdoc/en/reference/spl/arrayobject/count.xml Wed Jul 1 13:29:56 2009 @@ -1,9 +1,9 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry xml:id="arrayobject.count" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>ArrayObject::count</refname> - <refpurpose>Get the number of elements in the Iterator</refpurpose> + <refpurpose>Get the number of public properties in the ArrayObject</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; @@ -11,8 +11,9 @@ <type>int</type><methodname>ArrayObject::count</methodname> <void/> </methodsynopsis> - - &warn.undocumented.func; + <para> + Get the number of public properties in the <classname>ArrayObject</classname>. + </para> </refsect1> <refsect1 role="parameters"> @@ -23,10 +24,48 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - The number of elements in the Iterator. + The number of public properties in the <classname>ArrayObject</classname>. </para> + <note> + <para> + When the <classname>ArrayObject</classname> is constructed from an array all properties are public. + </para> + </note> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><methodname>ArrayObject::count</methodname> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +class Example { + public $public = 'prop:public'; + private $prv = 'prop:private'; + protected $prt = 'prop:protected'; +} + +$arrayobj = new ArrayObject(new Example()); +var_dump($arrayobj->count()); + +$arrayobj = new ArrayObject(array('first','second','third')); +var_dump($arrayobj->count()); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +int(1) +int(3) +]]> + </screen> + </example> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/arrayobject/offsetunset.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/spl/arrayobject/offsetunset.xml diff -u phpdoc/en/reference/spl/arrayobject/offsetunset.xml:1.4 phpdoc/en/reference/spl/arrayobject/offsetunset.xml:1.5 --- phpdoc/en/reference/spl/arrayobject/offsetunset.xml:1.4 Thu Mar 20 01:25:03 2008 +++ phpdoc/en/reference/spl/arrayobject/offsetunset.xml Wed Jul 1 13:29:56 2009 @@ -1,9 +1,9 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry xml:id="arrayobject.offsetunset" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>ArrayObject::offsetUnset</refname> - <refpurpose>Unsets the value at the specified $index</refpurpose> + <refpurpose>Unsets the value at the specified index</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; @@ -11,9 +11,6 @@ <type>void</type><methodname>ArrayObject::offsetUnset</methodname> <methodparam><type>mixed</type><parameter>index</parameter></methodparam> </methodsynopsis> - - &warn.undocumented.func; - <para> Unsets the value at the specified index. </para> @@ -42,6 +39,33 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><methodname>ArrayObject::offsetunset</methodname> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +$arrayobj = new ArrayObject(array(0=>'zero',2=>'two')); +$arrayobj->offsetunset(2); +var_dump($arrayobj); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +object(ArrayObject)#1 (1) { + [0]=> + string(4) "zero" +} +]]> + </screen> + </example> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/arrayobject/construct.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/spl/arrayobject/construct.xml diff -u phpdoc/en/reference/spl/arrayobject/construct.xml:1.4 phpdoc/en/reference/spl/arrayobject/construct.xml:1.5 --- phpdoc/en/reference/spl/arrayobject/construct.xml:1.4 Thu Mar 20 01:25:03 2008 +++ phpdoc/en/reference/spl/arrayobject/construct.xml Wed Jul 1 13:29:56 2009 @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry xml:id="arrayobject.construct" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>ArrayObject::__construct</refname> @@ -10,7 +10,9 @@ &reftitle.description; <constructorsynopsis> <methodname>ArrayObject::__construct</methodname> - <methodparam><type>mixed</type><parameter>input</parameter></methodparam> + <methodparam choice="opt"><type>mixed</type><parameter>input</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>iterator_class</parameter></methodparam> </constructorsynopsis> <para> This constructs a new array <type>object</type>. @@ -26,7 +28,24 @@ <listitem> <para> The <parameter>input</parameter> parameter accepts an - <type>array</type> or another <classname>ArrayObject</classname>. + <type>array</type> or an <type>Object</type>. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>flags</parameter></term> + <listitem> + <para> + Flags to control the behaviour of the <classname>ArrayObject</classname> object. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>iterator_class</parameter></term> + <listitem> + <para> + Specify the class that will be used for iteration of the <classname>ArrayObject</classname> object. + <classname>ArrayIterator</classname> is the default class used. </para> </listitem> </varlistentry> @@ -75,6 +94,16 @@ </example> </para> </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><methodname>ArrayObject::setflags</methodname></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/arrayobject/offsetset.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/spl/arrayobject/offsetset.xml diff -u phpdoc/en/reference/spl/arrayobject/offsetset.xml:1.4 phpdoc/en/reference/spl/arrayobject/offsetset.xml:1.5 --- phpdoc/en/reference/spl/arrayobject/offsetset.xml:1.4 Thu Mar 20 01:25:03 2008 +++ phpdoc/en/reference/spl/arrayobject/offsetset.xml Wed Jul 1 13:29:56 2009 @@ -1,9 +1,9 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry xml:id="arrayobject.offsetset" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>ArrayObject::offsetSet</refname> - <refpurpose>Sets the value at the specified $index to $newval</refpurpose> + <refpurpose>Sets the value at the specified index to newval</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; @@ -13,8 +13,6 @@ <methodparam><type>mixed</type><parameter>newval</parameter></methodparam> </methodsynopsis> - &warn.undocumented.func; - <para> Sets the value at the specified index to newval. </para> @@ -51,6 +49,67 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><methodname>ArrayObject::offsetset</methodname> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +class Example { + public $property = 'prop:public'; +} +$arrayobj = new ArrayObject(new Example()); +$arrayobj->offsetset(4, 'four'); +$arrayobj->offsetset('group', array('g1', 'g2')); +var_dump($arrayobj); + +$arrayobj = new ArrayObject(array('zero','one')); +$arrayobj->offsetset(null, 'last'); +var_dump($arrayobj); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +object(ArrayObject)#1 (3) { + ["property"]=> + string(11) "prop:public" + [4]=> + string(4) "four" + ["group"]=> + array(2) { + [0]=> + string(2) "g1" + [1]=> + string(2) "g2" + } +} +object(ArrayObject)#3 (3) { + [0]=> + string(4) "zero" + [1]=> + string(3) "one" + [2]=> + string(4) "last" +} +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><methodname>ArrayObject::append</methodname></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/arrayobject/offsetget.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/spl/arrayobject/offsetget.xml diff -u phpdoc/en/reference/spl/arrayobject/offsetget.xml:1.4 phpdoc/en/reference/spl/arrayobject/offsetget.xml:1.5 --- phpdoc/en/reference/spl/arrayobject/offsetget.xml:1.4 Thu Mar 20 01:25:03 2008 +++ phpdoc/en/reference/spl/arrayobject/offsetget.xml Wed Jul 1 13:29:56 2009 @@ -1,9 +1,9 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry xml:id="arrayobject.offsetget" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>ArrayObject::offsetGet</refname> - <refpurpose>Returns the value at the specified $index</refpurpose> + <refpurpose>Returns the value at the specified index</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; @@ -11,8 +11,6 @@ <type>mixed</type><methodname>ArrayObject::offsetGet</methodname> <methodparam><type>mixed</type><parameter>index</parameter></methodparam> </methodsynopsis> - - &warn.undocumented.func; </refsect1> <refsect1 role="parameters"> @@ -34,7 +32,34 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - The value at the specified $index. + The value at the specified index or &false;. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><methodname>ArrayObject::offsetget</methodname> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +$arrayobj = new ArrayObject(array('zero', 7, 'example'=>'e.g.')); +var_dump($arrayobj->offsetget(1)); +var_dump($arrayobj->offsetget('example')); +var_dump($arrayobj->offsetexists('notfound')); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +int(7) +string(4) "e.g." +bool(false) +]]> + </screen> + </example> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/arrayobject/append.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/spl/arrayobject/append.xml diff -u phpdoc/en/reference/spl/arrayobject/append.xml:1.4 phpdoc/en/reference/spl/arrayobject/append.xml:1.5 --- phpdoc/en/reference/spl/arrayobject/append.xml:1.4 Thu Mar 20 01:25:03 2008 +++ phpdoc/en/reference/spl/arrayobject/append.xml Wed Jul 1 13:29:56 2009 @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry xml:id="arrayobject.append" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>ArrayObject::append</refname> @@ -9,15 +9,34 @@ &reftitle.description; <methodsynopsis> <type>void</type><methodname>ArrayObject::append</methodname> - <methodparam><type>mixed</type><parameter>newval</parameter></methodparam> + <methodparam><type>mixed</type><parameter>value</parameter></methodparam> </methodsynopsis> - - &warn.undocumented.func; + <para> + Appends a new value as the last element. + </para> + <note> + <para> + This method cannot be called when the <classname>ArrayObject</classname> + was constructed from an object. + Use <methodname>ArrayObject::offsetset</methodname> instead. + </para> + </note> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; - &no.function.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>value</parameter></term> + <listitem> + <para> + The value being appended. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> </refsect1> <refsect1 role="returnvalues"> @@ -27,6 +46,56 @@ </para> </refsect1> +<refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><methodname>ArrayObject::append</methodname> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +$arrayobj = new ArrayObject(array('first','second','third')); +$arrayobj->append('fourth'); +$arrayobj->append(array('five', 'six')); +var_dump($arrayobj); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +object(ArrayObject)#1 (5) { + [0]=> + string(5) "first" + [1]=> + string(6) "second" + [2]=> + string(5) "third" + [3]=> + string(6) "fourth" + [4]=> + array(2) { + [0]=> + string(4) "five" + [1]=> + string(3) "six" + } +} +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><methodname>ArrayObject::offsetset</methodname></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/arrayobject/offsetexists.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/spl/arrayobject/offsetexists.xml diff -u phpdoc/en/reference/spl/arrayobject/offsetexists.xml:1.4 phpdoc/en/reference/spl/arrayobject/offsetexists.xml:1.5 --- phpdoc/en/reference/spl/arrayobject/offsetexists.xml:1.4 Thu Mar 20 01:25:03 2008 +++ phpdoc/en/reference/spl/arrayobject/offsetexists.xml Wed Jul 1 13:29:56 2009 @@ -1,9 +1,9 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry xml:id="arrayobject.offsetexists" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>ArrayObject::offsetExists</refname> - <refpurpose>Returns whether the requested $index exists</refpurpose> + <refpurpose>Returns whether the requested index exists</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; @@ -11,8 +11,6 @@ <type>bool</type><methodname>ArrayObject::offsetExists</methodname> <methodparam><type>mixed</type><parameter>index</parameter></methodparam> </methodsynopsis> - - &warn.undocumented.func; </refsect1> <refsect1 role="parameters"> @@ -34,7 +32,34 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - &true; if the requested $index exists, otherwise &false; + &true; if the requested index exists, otherwise &false; + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><methodname>ArrayObject::offsetexists</methodname> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +$arrayobj = new ArrayObject(array('zero', 'one', 'example'=>'e.g.')); +var_dump($arrayobj->offsetexists(1)); +var_dump($arrayobj->offsetexists('example')); +var_dump($arrayobj->offsetexists('notfound')); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +bool(true) +bool(true) +bool(false) +]]> + </screen> + </example> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/arrayobject/count.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/spl/arrayobject/count.xml diff -u phpdoc/en/reference/spl/arrayobject/count.xml:1.4 phpdoc/en/reference/spl/arrayobject/count.xml:1.5 --- phpdoc/en/reference/spl/arrayobject/count.xml:1.4 Thu Mar 20 01:25:03 2008 +++ phpdoc/en/reference/spl/arrayobject/count.xml Wed Jul 1 13:29:56 2009 @@ -1,9 +1,9 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry xml:id="arrayobject.count" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>ArrayObject::count</refname> - <refpurpose>Get the number of elements in the Iterator</refpurpose> + <refpurpose>Get the number of public properties in the ArrayObject</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; @@ -11,8 +11,9 @@ <type>int</type><methodname>ArrayObject::count</methodname> <void/> </methodsynopsis> - - &warn.undocumented.func; + <para> + Get the number of public properties in the <classname>ArrayObject</classname>. + </para> </refsect1> <refsect1 role="parameters"> @@ -23,10 +24,48 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - The number of elements in the Iterator. + The number of public properties in the <classname>ArrayObject</classname>. </para> + <note> + <para> + When the <classname>ArrayObject</classname> is constructed from an array all properties are public. + </para> + </note> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><methodname>ArrayObject::count</methodname> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +class Example { + public $public = 'prop:public'; + private $prv = 'prop:private'; + protected $prt = 'prop:protected'; +} + +$arrayobj = new ArrayObject(new Example()); +var_dump($arrayobj->count()); + +$arrayobj = new ArrayObject(array('first','second','third')); +var_dump($arrayobj->count()); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +int(1) +int(3) +]]> + </screen> + </example> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/arrayobject/offsetunset.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/spl/arrayobject/offsetunset.xml diff -u phpdoc/en/reference/spl/arrayobject/offsetunset.xml:1.4 phpdoc/en/reference/spl/arrayobject/offsetunset.xml:1.5 --- phpdoc/en/reference/spl/arrayobject/offsetunset.xml:1.4 Thu Mar 20 01:25:03 2008 +++ phpdoc/en/reference/spl/arrayobject/offsetunset.xml Wed Jul 1 13:29:56 2009 @@ -1,9 +1,9 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry xml:id="arrayobject.offsetunset" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>ArrayObject::offsetUnset</refname> - <refpurpose>Unsets the value at the specified $index</refpurpose> + <refpurpose>Unsets the value at the specified index</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; @@ -11,9 +11,6 @@ <type>void</type><methodname>ArrayObject::offsetUnset</methodname> <methodparam><type>mixed</type><parameter>index</parameter></methodparam> </methodsynopsis> - - &warn.undocumented.func; - <para> Unsets the value at the specified index. </para> @@ -42,6 +39,33 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><methodname>ArrayObject::offsetunset</methodname> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +$arrayobj = new ArrayObject(array(0=>'zero',2=>'two')); +$arrayobj->offsetunset(2); +var_dump($arrayobj); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +object(ArrayObject)#1 (1) { + [0]=> + string(4) "zero" +} +]]> + </screen> + </example> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/arrayobject/construct.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/spl/arrayobject/construct.xml diff -u phpdoc/en/reference/spl/arrayobject/construct.xml:1.4 phpdoc/en/reference/spl/arrayobject/construct.xml:1.5 --- phpdoc/en/reference/spl/arrayobject/construct.xml:1.4 Thu Mar 20 01:25:03 2008 +++ phpdoc/en/reference/spl/arrayobject/construct.xml Wed Jul 1 13:29:56 2009 @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry xml:id="arrayobject.construct" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>ArrayObject::__construct</refname> @@ -10,7 +10,9 @@ &reftitle.description; <constructorsynopsis> <methodname>ArrayObject::__construct</methodname> - <methodparam><type>mixed</type><parameter>input</parameter></methodparam> + <methodparam choice="opt"><type>mixed</type><parameter>input</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>iterator_class</parameter></methodparam> </constructorsynopsis> <para> This constructs a new array <type>object</type>. @@ -26,7 +28,24 @@ <listitem> <para> The <parameter>input</parameter> parameter accepts an - <type>array</type> or another <classname>ArrayObject</classname>. + <type>array</type> or an <type>Object</type>. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>flags</parameter></term> + <listitem> + <para> + Flags to control the behaviour of the <classname>ArrayObject</classname> object. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>iterator_class</parameter></term> + <listitem> + <para> + Specify the class that will be used for iteration of the <classname>ArrayObject</classname> object. + <classname>ArrayIterator</classname> is the default class used. </para> </listitem> </varlistentry> @@ -75,6 +94,16 @@ </example> </para> </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><methodname>ArrayObject::setflags</methodname></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/arrayobject/offsetset.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/spl/arrayobject/offsetset.xml diff -u phpdoc/en/reference/spl/arrayobject/offsetset.xml:1.4 phpdoc/en/reference/spl/arrayobject/offsetset.xml:1.5 --- phpdoc/en/reference/spl/arrayobject/offsetset.xml:1.4 Thu Mar 20 01:25:03 2008 +++ phpdoc/en/reference/spl/arrayobject/offsetset.xml Wed Jul 1 13:29:56 2009 @@ -1,9 +1,9 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry xml:id="arrayobject.offsetset" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>ArrayObject::offsetSet</refname> - <refpurpose>Sets the value at the specified $index to $newval</refpurpose> + <refpurpose>Sets the value at the specified index to newval</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; @@ -13,8 +13,6 @@ <methodparam><type>mixed</type><parameter>newval</parameter></methodparam> </methodsynopsis> - &warn.undocumented.func; - <para> Sets the value at the specified index to newval. </para> @@ -51,6 +49,67 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><methodname>ArrayObject::offsetset</methodname> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +class Example { + public $property = 'prop:public'; +} +$arrayobj = new ArrayObject(new Example()); +$arrayobj->offsetset(4, 'four'); +$arrayobj->offsetset('group', array('g1', 'g2')); +var_dump($arrayobj); + +$arrayobj = new ArrayObject(array('zero','one')); +$arrayobj->offsetset(null, 'last'); +var_dump($arrayobj); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +object(ArrayObject)#1 (3) { + ["property"]=> + string(11) "prop:public" + [4]=> + string(4) "four" + ["group"]=> + array(2) { + [0]=> + string(2) "g1" + [1]=> + string(2) "g2" + } +} +object(ArrayObject)#3 (3) { + [0]=> + string(4) "zero" + [1]=> + string(3) "one" + [2]=> + string(4) "last" +} +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><methodname>ArrayObject::append</methodname></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/arrayobject/offsetget.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/spl/arrayobject/offsetget.xml diff -u phpdoc/en/reference/spl/arrayobject/offsetget.xml:1.4 phpdoc/en/reference/spl/arrayobject/offsetget.xml:1.5 --- phpdoc/en/reference/spl/arrayobject/offsetget.xml:1.4 Thu Mar 20 01:25:03 2008 +++ phpdoc/en/reference/spl/arrayobject/offsetget.xml Wed Jul 1 13:29:56 2009 @@ -1,9 +1,9 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry xml:id="arrayobject.offsetget" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>ArrayObject::offsetGet</refname> - <refpurpose>Returns the value at the specified $index</refpurpose> + <refpurpose>Returns the value at the specified index</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; @@ -11,8 +11,6 @@ <type>mixed</type><methodname>ArrayObject::offsetGet</methodname> <methodparam><type>mixed</type><parameter>index</parameter></methodparam> </methodsynopsis> - - &warn.undocumented.func; </refsect1> <refsect1 role="parameters"> @@ -34,7 +32,34 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - The value at the specified $index. + The value at the specified index or &false;. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><methodname>ArrayObject::offsetget</methodname> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +$arrayobj = new ArrayObject(array('zero', 7, 'example'=>'e.g.')); +var_dump($arrayobj->offsetget(1)); +var_dump($arrayobj->offsetget('example')); +var_dump($arrayobj->offsetexists('notfound')); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +int(7) +string(4) "e.g." +bool(false) +]]> + </screen> + </example> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/arrayobject/append.xml?r1=1.4&r2=1.5&diff_format=u Index: phpdoc/en/reference/spl/arrayobject/append.xml diff -u phpdoc/en/reference/spl/arrayobject/append.xml:1.4 phpdoc/en/reference/spl/arrayobject/append.xml:1.5 --- phpdoc/en/reference/spl/arrayobject/append.xml:1.4 Thu Mar 20 01:25:03 2008 +++ phpdoc/en/reference/spl/arrayobject/append.xml Wed Jul 1 13:29:56 2009 @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry xml:id="arrayobject.append" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>ArrayObject::append</refname> @@ -9,15 +9,34 @@ &reftitle.description; <methodsynopsis> <type>void</type><methodname>ArrayObject::append</methodname> - <methodparam><type>mixed</type><parameter>newval</parameter></methodparam> + <methodparam><type>mixed</type><parameter>value</parameter></methodparam> </methodsynopsis> - - &warn.undocumented.func; + <para> + Appends a new value as the last element. + </para> + <note> + <para> + This method cannot be called when the <classname>ArrayObject</classname> + was constructed from an object. + Use <methodname>ArrayObject::offsetset</methodname> instead. + </para> + </note> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; - &no.function.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>value</parameter></term> + <listitem> + <para> + The value being appended. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> </refsect1> <refsect1 role="returnvalues"> @@ -27,6 +46,56 @@ </para> </refsect1> +<refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><methodname>ArrayObject::append</methodname> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +$arrayobj = new ArrayObject(array('first','second','third')); +$arrayobj->append('fourth'); +$arrayobj->append(array('five', 'six')); +var_dump($arrayobj); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +object(ArrayObject)#1 (5) { + [0]=> + string(5) "first" + [1]=> + string(6) "second" + [2]=> + string(5) "third" + [3]=> + string(6) "fourth" + [4]=> + array(2) { + [0]=> + string(4) "five" + [1]=> + string(3) "six" + } +} +]]> + </screen> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><methodname>ArrayObject::offsetset</methodname></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file