<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>The Swoole\Table class</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="swoole-server.tick.html">Swoole\Server::tick</a></div> <div class="next" style="text-align: right; float: right;"><a href="swoole-table.column.html">Swoole\Table::column</a></div> <div class="up"><a href="book.swoole.html">Swoole</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="class.swoole-table" class="reference"> <h1 class="title">The Swoole\Table class</h1> <div class="partintro"><p class="verinfo">(PHP 5 >= 5.2.0, PHP 7, PECL swoole >= 1.9.0)</p> <div class="section" id="swoole-table.intro"> <h2 class="title">Introduction</h2> <p class="para"> </p> </div> <div class="section" id="swoole-table.synopsis"> <h2 class="title">Class synopsis</h2> <div class="classsynopsis"> <div class="ooclass"></div> <div class="classsynopsisinfo"> <span class="ooclass"> <strong class="classname">Swoole\Table</strong> </span> <span class="oointerface">implements <span class="interfacename"><a href="class.iterator.html" class="interfacename">Iterator</a></span> </span> <span class="oointerface">, <span class="interfacename"><a href="class.countable.html" class="interfacename">Countable</a></span> </span> {</div> <div class="classsynopsisinfo classsynopsisinfo_comment">/* Constants */</div> <div class="fieldsynopsis"> <span class="modifier">const</span> <span class="type">integer</span> <var class="fieldsynopsis_varname"><a href="class.swoole-table.html#swoole-table.constants.type-int"><var class="varname">TYPE_INT</var></a></var> <span class="initializer"> = 1</span> ;</div> <div class="fieldsynopsis"> <span class="modifier">const</span> <span class="type">integer</span> <var class="fieldsynopsis_varname"><a href="class.swoole-table.html#swoole-table.constants.type-string"><var class="varname">TYPE_STRING</var></a></var> <span class="initializer"> = 7</span> ;</div> <div class="fieldsynopsis"> <span class="modifier">const</span> <span class="type">integer</span> <var class="fieldsynopsis_varname"><a href="class.swoole-table.html#swoole-table.constants.type-float"><var class="varname">TYPE_FLOAT</var></a></var> <span class="initializer"> = 6</span> ;</div> <div class="classsynopsisinfo classsynopsisinfo_comment">/* Methods */</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">ReturnType</span> <span class="methodname"><a href="swoole-table.column.html" class="methodname">column</a></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span> , <span class="methodparam"><span class="type">string</span> <code class="parameter">$type</code></span> [, <span class="methodparam"><span class="type">integer</span> <code class="parameter">$size</code></span> ] )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">integer</span> <span class="methodname"><a href="swoole-table.count.html" class="methodname">count</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="swoole-table.create.html" class="methodname">create</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">array</span> <span class="methodname"><a href="swoole-table.current.html" class="methodname">current</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">ReturnType</span> <span class="methodname"><a href="swoole-table.decr.html" class="methodname">decr</a></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$key</code></span> , <span class="methodparam"><span class="type">string</span> <code class="parameter">$column</code></span> [, <span class="methodparam"><span class="type">integer</span> <code class="parameter">$decrby</code></span> ] )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="swoole-table.del.html" class="methodname">del</a></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$key</code></span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="swoole-table.destroy.html" class="methodname">destroy</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">boolean</span> <span class="methodname"><a href="swoole-table.exist.html" class="methodname">exist</a></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$key</code></span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">integer</span> <span class="methodname"><a href="swoole-table.get.html" class="methodname">get</a></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$row_key</code></span> , <span class="methodparam"><span class="type">string</span> <code class="parameter">$column_key</code></span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="swoole-table.incr.html" class="methodname">incr</a></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$key</code></span> , <span class="methodparam"><span class="type">string</span> <code class="parameter">$column</code></span> [, <span class="methodparam"><span class="type">integer</span> <code class="parameter">$incrby</code></span> ] )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">string</span> <span class="methodname"><a href="swoole-table.key.html" class="methodname">key</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">ReturnType</span> <span class="methodname"><a href="swoole-table.next.html" class="methodname">next</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="swoole-table.rewind.html" class="methodname">rewind</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">VOID</span> <span class="methodname"><a href="swoole-table.set.html" class="methodname">set</a></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$key</code></span> , <span class="methodparam"><span class="type">array</span> <code class="parameter">$value</code></span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">boolean</span> <span class="methodname"><a href="swoole-table.valid.html" class="methodname">valid</a></span> ( <span class="methodparam">void</span> )</div> }</div> </div> <div class="section" id="swoole-table.constants"> <h2 class="title">Predefined Constants</h2> <dl> <dt id="swoole-table.constants.type-int"><strong><code>Swoole\Table::TYPE_INT</code></strong></dt> <dd> <p class="para"/> </dd> <dt id="swoole-table.constants.type-string"><strong><code>Swoole\Table::TYPE_STRING</code></strong></dt> <dd> <p class="para"/> </dd> <dt id="swoole-table.constants.type-float"><strong><code>Swoole\Table::TYPE_FLOAT</code></strong></dt> <dd> <p class="para"/> </dd> </dl> </div> </div> <h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="swoole-table.column.html">Swoole\Table::column</a> — Set the data type and size of the columns.</li><li><a href="swoole-table.construct.html">Swoole\Table::__construct</a> — Construct a Swoole memory table with fixed size.</li><li><a href="swoole-table.count.html">Swoole\Table::count</a> — Count the rows in the table, or count all the elements in the table if $mode = 1.</li><li><a href="swoole-table.create.html">Swoole\Table::create</a> — Create the swoole memory table.</li><li><a href="swoole-table.current.html">Swoole\Table::current</a> — Get the current row.</li><li><a href="swoole-table.decr.html">Swoole\Table::decr</a> — Decrement the value in the Swoole table by $row_key and $column_key.</li><li><a href="swoole-table.del.html">Swoole\Table::del</a> — Delete a row in the Swoole table by $row_key.</li><li><a href="swoole-table.destroy.html">Swoole\Table::destroy</a> — Destroy the Swoole table.</li><li><a href="swoole-table.exist.html">Swoole\Table::exist</a> — Check if a row is existed by $row_key.</li><li><a href="swoole-table.get.html">Swoole\Table::get</a> — Get the value in the Swoole table by $row_key and $column_key.</li><li><a href="swoole-table.incr.html">Swoole\Table::incr</a> — Increment the value by $row_key and $column_key.</li><li><a href="swoole-table.key.html">Swoole\Table::key</a> — Get the key of current row.</li><li><a href="swoole-table.next.html">Swoole\Table::next</a> — Iterator the next row.</li><li><a href="swoole-table.rewind.html">Swoole\Table::rewind</a> — Rewind the iterator.</li><li><a href="swoole-table.set.html">Swoole\Table::set</a> — Update a row of the table by $row_key.</li><li><a href="swoole-table.valid.html">Swoole\Table::valid</a> — Check current if the current row is valid.</li></ul> </div> <hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="swoole-server.tick.html">Swoole\Server::tick</a></div> <div class="next" style="text-align: right; float: right;"><a href="swoole-table.column.html">Swoole\Table::column</a></div> <div class="up"><a href="book.swoole.html">Swoole</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>