reference/sqlite3/sqlite3/createfunction.xml
855bfee2f3db70d7dbb4c60c7c4a4efa567f1c60
...
...
@@ -1,6 +1,5 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-

4
3
<refentry xml:id="sqlite3.createfunction" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
4
<refnamediv>
6
5
<refname>SQLite3::createFunction</refname>
...
...
@@ -9,11 +8,12 @@
9
8

10
9
<refsect1 role="description">
11
10
&reftitle.description;
12
-
<methodsynopsis>
11
+
<methodsynopsis role="SQLite3">
13
12
<modifier>public</modifier> <type>bool</type><methodname>SQLite3::createFunction</methodname>
14
13
<methodparam><type>string</type><parameter>name</parameter></methodparam>
15
-
<methodparam><type>mixed</type><parameter>callback</parameter></methodparam>
16
-
<methodparam choice="opt"><type>int</type><parameter>argument_count</parameter><initializer>-1</initializer></methodparam>
14
+
<methodparam><type>callable</type><parameter>callback</parameter></methodparam>
15
+
<methodparam choice="opt"><type>int</type><parameter>argCount</parameter><initializer>-1</initializer></methodparam>
16
+
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>0</initializer></methodparam>
17
17
</methodsynopsis>
18
18
<para>
19
19
Registers a PHP function or user-defined function for use as an SQL scalar
...
...
@@ -40,18 +40,55 @@
40
40
The name of a PHP function or user-defined function to apply as a
41
41
callback, defining the behavior of the SQL function.
42
42
</para>
43
+
<para>
44
+
This function need to be defined as:
45
+
<methodsynopsis>
46
+
<type>mixed</type><methodname><replaceable>callback</replaceable></methodname>
47
+
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
48
+
<methodparam rep="repeat"><type>mixed</type><parameter>values</parameter></methodparam>
49
+
</methodsynopsis>
50
+
<variablelist>
51
+
<varlistentry>
52
+
<term><parameter>value</parameter></term>
53
+
<listitem>
54
+
<para>
55
+
The first argument passed to the SQL function.
56
+
</para>
57
+
</listitem>
58
+
</varlistentry>
59
+
<varlistentry>
60
+
<term><parameter>values</parameter></term>
61
+
<listitem>
62
+
<para>
63
+
Further arguments passed to the SQL function.
64
+
</para>
65
+
</listitem>
66
+
</varlistentry>
67
+
</variablelist>
68
+
</para>
43
69
</listitem>
44
70
</varlistentry>
45
71
<varlistentry>
46
-
<term><parameter>argument_count</parameter></term>
72
+
<term><parameter>argCount</parameter></term>
47
73
<listitem>
48
74
<para>
49
75
The number of arguments that the SQL function takes. If
50
-
this parameter is negative, then the SQL function may take
76
+
this parameter is <literal>-1</literal>, then the SQL function may take
51
77
any number of arguments.
52
78
</para>
53
79
</listitem>
54
80
</varlistentry>
81
+
<varlistentry>
82
+
<term><parameter>flags</parameter></term>
83
+
<listitem>
84
+
<para>
85
+
A bitwise conjunction of flags. Currently, only
86
+
<constant>SQLITE3_DETERMINISTIC</constant> is supported, which specifies
87
+
that the function always returns the same result given the same inputs
88
+
within a single SQL statement.
89
+
</para>
90
+
</listitem>
91
+
</varlistentry>
55
92
</variablelist>
56
93
</para>
57
94

...
...
@@ -64,6 +101,28 @@
64
101
</para>
65
102
</refsect1>
66
103

104
+
<refsect1 role="changelog">
105
+
&reftitle.changelog;
106
+
<informaltable>
107
+
<tgroup cols="2">
108
+
<thead>
109
+
<row>
110
+
<entry>&Version;</entry>
111
+
<entry>&Description;</entry>
112
+
</row>
113
+
</thead>
114
+
<tbody>
115
+
<row>
116
+
<entry>7.1.4</entry>
117
+
<entry>
118
+
The <parameter>flags</parameter> parameter has been added.
119
+
</entry>
120
+
</row>
121
+
</tbody>
122
+
</tgroup>
123
+
</informaltable>
124
+
</refsect1>
125
+

67
126
<refsect1 role="examples">
68
127
&reftitle.examples;
69
128
<para>
...
...
@@ -94,7 +153,6 @@ string(32) "098f6bcd4621d373cade4e832627b4f6"
94
153
</refsect1>
95
154

96
155
</refentry>
97
-

98
156
<!-- Keep this comment at the end of the file
99
157
Local variables:
100
158
mode: sgml
101
159