reference/pdo/pdostatement/fetchobject.xml
082ddc19f53e6e254010de1a1fbbe485ff744ec1
...
...
@@ -3,22 +3,26 @@
3
3
<refentry xml:id="pdostatement.fetchobject" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>PDOStatement::fetchObject</refname>
6
-
<refpurpose>Fetches the next row and returns it as an object.</refpurpose>
6
+
<refpurpose>Fetches the next row and returns it as an object</refpurpose>
7
7
</refnamediv>
8
8
<refsect1 role="description">
9
9
&reftitle.description;
10
-
<methodsynopsis>
11
-
<type>mixed</type><methodname>PDOStatement::fetchObject</methodname>
12
-
<methodparam choice="opt"><type>string</type><parameter>class_name</parameter><initializer>"stdClass"</initializer></methodparam>
13
-
<methodparam choice="opt"><type>array</type><parameter>ctor_args</parameter></methodparam>
10
+
<methodsynopsis role="PDOStatement">
11
+
<modifier>public</modifier> <type class="union"><type>object</type><type>false</type></type><methodname>PDOStatement::fetchObject</methodname>
12
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>class</parameter><initializer>"stdClass"</initializer></methodparam>
13
+
<methodparam choice="opt"><type>array</type><parameter>constructorArgs</parameter><initializer>[]</initializer></methodparam>
14
14
</methodsynopsis>
15
15

16
16
<para>
17
17
Fetches the next row and returns it as an object. This function is an
18
-
alternative to <function>PDOStatement::fetch</function> with
18
+
alternative to <methodname>PDOStatement::fetch</methodname> with
19
19
<constant>PDO::FETCH_CLASS</constant> or
20
20
<constant>PDO::FETCH_OBJ</constant> style.
21
21
</para>
22
+
<para>
23
+
When an object is fetched, its properties are assigned from respective
24
+
column values, and afterwards its constructor is invoked.
25
+
</para>
22
26

23
27
</refsect1>
24
28
<refsect1 role="parameters">
...
...
@@ -26,7 +30,7 @@
26
30
<para>
27
31
<variablelist>
28
32
<varlistentry>
29
-
<term><parameter>class_name</parameter></term>
33
+
<term><parameter>class</parameter></term>
30
34
<listitem>
31
35
<para>
32
36
Name of the created class.
...
...
@@ -34,7 +38,7 @@
34
38
</listitem>
35
39
</varlistentry>
36
40
<varlistentry>
37
-
<term><parameter>ctor_args</parameter></term>
41
+
<term><parameter>constructorArgs</parameter></term>
38
42
<listitem>
39
43
<para>
40
44
Elements of this array are passed to the constructor.
...
...
@@ -52,18 +56,22 @@
52
56
</para>
53
57
</refsect1>
54
58

59
+
<refsect1 role="errors">
60
+
&reftitle.errors;
61
+
&pdo.errors;
62
+
</refsect1>
63
+

55
64
<refsect1 role="seealso">
56
65
&reftitle.seealso;
57
66
<para>
58
67
<simplelist>
59
-
<member><function>PDOStatement::fetch</function></member>
68
+
<member><methodname>PDOStatement::fetch</methodname></member>
60
69
</simplelist>
61
70
</para>
62
71
</refsect1>
63
72

64
73

65
74
</refentry>
66
-

67
75
<!-- Keep this comment at the end of the file
68
76
Local variables:
69
77
mode: sgml
70
78