From 56c22ac5c49711d660d74e127f622a88513b4c84 Mon Sep 17 00:00:00 2001 From: Mikko Koppanen Date: Sat, 2 Jan 2010 01:56:39 +0000 Subject: [PATCH] Added documentation for TokyoTyrantIterator git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@292910 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../tokyo_tyrant/tokyotyrant/getiterator.xml | 85 ++++++++++++++ .../tokyo_tyrant/tokyotyrantiterator.xml | 76 +++++++++++++ .../tokyotyrantiterator/construct.xml | 107 ++++++++++++++++++ .../tokyotyrantiterator/current.xml | 66 +++++++++++ .../tokyo_tyrant/tokyotyrantiterator/key.xml | 66 +++++++++++ .../tokyo_tyrant/tokyotyrantiterator/next.xml | 66 +++++++++++ .../tokyotyrantiterator/rewind.xml | 66 +++++++++++ .../tokyotyrantiterator/valid.xml | 66 +++++++++++ .../tokyotyranttable/getiterator.xml | 85 ++++++++++++++ reference/tokyo_tyrant/versions.xml | 6 + 10 files changed, 689 insertions(+) create mode 100644 reference/tokyo_tyrant/tokyotyrant/getiterator.xml create mode 100644 reference/tokyo_tyrant/tokyotyrantiterator.xml create mode 100644 reference/tokyo_tyrant/tokyotyrantiterator/construct.xml create mode 100644 reference/tokyo_tyrant/tokyotyrantiterator/current.xml create mode 100644 reference/tokyo_tyrant/tokyotyrantiterator/key.xml create mode 100644 reference/tokyo_tyrant/tokyotyrantiterator/next.xml create mode 100644 reference/tokyo_tyrant/tokyotyrantiterator/rewind.xml create mode 100644 reference/tokyo_tyrant/tokyotyrantiterator/valid.xml create mode 100644 reference/tokyo_tyrant/tokyotyranttable/getiterator.xml diff --git a/reference/tokyo_tyrant/tokyotyrant/getiterator.xml b/reference/tokyo_tyrant/tokyotyrant/getiterator.xml new file mode 100644 index 0000000000..9ad8d9cebe --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrant/getiterator.xml @@ -0,0 +1,85 @@ + + + + + + TokyoTyrant::getIterator + Get an iterator + + + + &reftitle.description; + + public TokyoTyrantIteratorTokyoTyrant::getIterator + + + + Gets an iterator for iterating all keys / values in the database. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + This method returns TokyoTyrantIterator object and throws TokyoTyrantException on failure. + + + + + &reftitle.examples; + + + <methodname>TokyoTyrant::getIterator</methodname> example + +getIterator(); + +foreach ($it as $k => $v) { + +} +?> +]]> + + + + + + + &reftitle.seealso; + + + TokyoTyrantTable::getQuery + TokyoTyrantTable::getIterator + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrantiterator.xml b/reference/tokyo_tyrant/tokyotyrantiterator.xml new file mode 100644 index 0000000000..d441d16a74 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrantiterator.xml @@ -0,0 +1,76 @@ + + + + + + The TokyoTyrantIterator class + TokyoTyrantIterator + + + + +
+ &reftitle.intro; + + Provides an iterator for TokyoTyrant and TokyoTyrantTable objects. The iterator iterates over + over all keys and values in the database. TokyoTyrantIterator was added in version 0.2.0. +
+ + +
+ &reftitle.classsynopsis; + + + + TokyoTyrantIterator + + + + + TokyoTyrantIterator + + + + implements + Iterator + + + + + Methods + + + Inherited methods + + + + + +
+ +
+ + &reference.tokyo-tyrant.entities.tokyotyrantiterator; + +
+ + diff --git a/reference/tokyo_tyrant/tokyotyrantiterator/construct.xml b/reference/tokyo_tyrant/tokyotyrantiterator/construct.xml new file mode 100644 index 0000000000..3d6cba9cea --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrantiterator/construct.xml @@ -0,0 +1,107 @@ + + + + + + TokyoTyrantIterator::__construct + Construct an iterator + + + + &reftitle.description; + + public TokyoTyrantIteratorTokyoTyrantIterator::__construct + mixedobject + + + Construct a new TokyoTyrantIterator object. One connection can have multiple iterators but it is not quaranteed + that all items are traversed in that case. object parameter can be either an of instance + TokyoTyrant or TokyoTyrantTable. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Throws an exception if iterator initialization fails. + + + + + &reftitle.examples; + + + <methodname>TokyoTyrantIterator::__construct</methodname> example + +put(null, array("column1" => "some data", "column2" => "more data")); + +/* Construct an iterator */ +$it = new TokyoTyrantIterator($tt); + +foreach ($it as $value) { + var_dump($value); +} +?> +]]> + + &example.outputs; + + + string(9) "some data" + ["column2"]=> + string(9) "more data" +} +]]> + + + + + + + &reftitle.seealso; + + + TokyoTyrantIterator::key + TokyoTyrantIterator::current + TokyoTyrantIterator::next + TokyoTyrantIterator::rewind + TokyoTyrantIterator::key + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrantiterator/current.xml b/reference/tokyo_tyrant/tokyotyrantiterator/current.xml new file mode 100644 index 0000000000..cec15d8953 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrantiterator/current.xml @@ -0,0 +1,66 @@ + + + + + + TokyoTyrantIterator::current + Get the current value + + + + &reftitle.description; + + public mixedTokyoTyrantIterator::current + + + + Returns the current value during iteration. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the current value on success and false on failure. + + + + + &reftitle.seealso; + + + TokyoTyrantIterator::valid + TokyoTyrantIterator::key + TokyoTyrantIterator::next + TokyoTyrantIterator::rewind + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrantiterator/key.xml b/reference/tokyo_tyrant/tokyotyrantiterator/key.xml new file mode 100644 index 0000000000..509f0441db --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrantiterator/key.xml @@ -0,0 +1,66 @@ + + + + + + TokyoTyrantIterator::key + Returns the current key + + + + &reftitle.description; + + public mixedTokyoTyrantIterator::key + + + + Returns the current key. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the current key on success and false on failure. + + + + + &reftitle.seealso; + + + TokyoTyrantIterator::valid + TokyoTyrantIterator::current + TokyoTyrantIterator::next + TokyoTyrantIterator::rewind + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrantiterator/next.xml b/reference/tokyo_tyrant/tokyotyrantiterator/next.xml new file mode 100644 index 0000000000..b9037cbff7 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrantiterator/next.xml @@ -0,0 +1,66 @@ + + + + + + TokyoTyrantIterator::next + Move to next key + + + + &reftitle.description; + + public mixedTokyoTyrantIterator::next + + + + Move to next key during iteration and return it's value. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the next value on success and false on failure. + + + + + &reftitle.seealso; + + + TokyoTyrantIterator::valid + TokyoTyrantIterator::key + TokyoTyrantIterator::current + TokyoTyrantIterator::rewind + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrantiterator/rewind.xml b/reference/tokyo_tyrant/tokyotyrantiterator/rewind.xml new file mode 100644 index 0000000000..c9e23256ae --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrantiterator/rewind.xml @@ -0,0 +1,66 @@ + + + + + + TokyoTyrantIterator::rewind + Rewinds the iterator + + + + &reftitle.description; + + public voidTokyoTyrantIterator::rewind + + + + Rewinds the iterator for new iteration. Called automatically at the beginning of foreach. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Throws TokyoTyrantException if iterator initialization fails. + + + + + &reftitle.seealso; + + + TokyoTyrantIterator::valid + TokyoTyrantIterator::current + TokyoTyrantIterator::next + TokyoTyrantIterator::rewind + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyrantiterator/valid.xml b/reference/tokyo_tyrant/tokyotyrantiterator/valid.xml new file mode 100644 index 0000000000..e2811473a1 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyrantiterator/valid.xml @@ -0,0 +1,66 @@ + + + + + + TokyoTyrantIterator::valid + Rewinds the iterator + + + + &reftitle.description; + + public booleanTokyoTyrantIterator::valid + + + + Checks whether the internal pointer points to valid element. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns true if the pointer points to correct element and false if not. + + + + + &reftitle.seealso; + + + TokyoTyrantIterator::key + TokyoTyrantIterator::current + TokyoTyrantIterator::next + TokyoTyrantIterator::rewind + + + + + + + diff --git a/reference/tokyo_tyrant/tokyotyranttable/getiterator.xml b/reference/tokyo_tyrant/tokyotyranttable/getiterator.xml new file mode 100644 index 0000000000..34e4c017a3 --- /dev/null +++ b/reference/tokyo_tyrant/tokyotyranttable/getiterator.xml @@ -0,0 +1,85 @@ + + + + + + TokyoTyrantTable::getIterator + Get an iterator + + + + &reftitle.description; + + public TokyoTyrantIteratorTokyoTyrantTable::getIterator + + + + Gets an iterator for iterating all keys / values in the database. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + This method returns TokyoTyrantIterator object and throws TokyoTyrantException on failure. + + + + + &reftitle.examples; + + + <methodname>TokyoTyrantTable::getIterator</methodname> example + +getIterator(); + +foreach ($it as $k => $v) { + var_dump($k, $v); +} +?> +]]> + + + + + + + &reftitle.seealso; + + + TokyoTyrantTable::getQuery + TokyoTyrant::getIterator + + + + + + + diff --git a/reference/tokyo_tyrant/versions.xml b/reference/tokyo_tyrant/versions.xml index b510e36da8..8cc43ca5de 100644 --- a/reference/tokyo_tyrant/versions.xml +++ b/reference/tokyo_tyrant/versions.xml @@ -76,6 +76,12 @@ Example entries: + + + + + +