<!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>Registers a PHP function for use as an SQL aggregate function</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="sqlite3.construct.html">SQLite3::__construct</a></div> <div class="next" style="text-align: right; float: right;"><a href="sqlite3.createcollation.html">SQLite3::createCollation</a></div> <div class="up"><a href="class.sqlite3.html">SQLite3</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="sqlite3.createaggregate" class="refentry"> <div class="refnamediv"> <h1 class="refname">SQLite3::createAggregate</h1> <p class="verinfo">(PHP 5 >= 5.3.0)</p><p class="refpurpose"><span class="refname">SQLite3::createAggregate</span> — <span class="dc-title">Registers a PHP function for use as an SQL aggregate function</span></p> </div> <div class="refsect1 description" id="refsect1-sqlite3.createaggregate-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><strong>SQLite3::createAggregate</strong></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span> , <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$step_callback</code></span> , <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$final_callback</code></span> [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$argument_count</code><span class="initializer"> = -1</span></span> ] )</div> <p class="para rdfs-comment"> Registers a PHP function or user-defined function for use as an SQL aggregate function for use within SQL statements. </p> </div> <div class="refsect1 parameters" id="refsect1-sqlite3.createaggregate-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">name</code></em></span> <dd> <p class="para"> Name of the SQL aggregate to be created or redefined. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">step_callback</code></em></span> <dd> <p class="para"> The name of a PHP function or user-defined function to apply as a callback for every item in the aggregate. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">final_callback</code></em></span> <dd> <p class="para"> The name of a PHP function or user-defined function to apply as a callback at the end of the aggregate data. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">argument_count</code></em></span> <dd> <p class="para"> The number of arguments that the SQL aggregate takes. If this parameter is negative, then the SQL aggregate may take any number of arguments. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-sqlite3.createaggregate-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <strong><code>TRUE</code></strong> upon successful creation of the aggregate, <strong><code>FALSE</code></strong> on failure. </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="sqlite3.construct.html">SQLite3::__construct</a></div> <div class="next" style="text-align: right; float: right;"><a href="sqlite3.createcollation.html">SQLite3::createCollation</a></div> <div class="up"><a href="class.sqlite3.html">SQLite3</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>