From e6867318b3e33c1535e505098786d666cccd48ff Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 25 Mar 2023 13:12:07 +0900 Subject: [PATCH 1/4] docs: replace With with with --- user_guide_src/source/database/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/database/index.rst b/user_guide_src/source/database/index.rst index 73cd1a4ecff9..0862ec0f4125 100644 --- a/user_guide_src/source/database/index.rst +++ b/user_guide_src/source/database/index.rst @@ -1,5 +1,5 @@ ###################### -Working With Databases +Working with Databases ###################### CodeIgniter comes with a full-featured and very fast abstracted database From b89a97f6517bdcec434b2630fafc95fd85587c05 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 25 Mar 2023 13:12:26 +0900 Subject: [PATCH 2/4] docs: increase TOC depth --- user_guide_src/source/database/results.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/database/results.rst b/user_guide_src/source/database/results.rst index 39dd584e8003..2dda585d9b2c 100644 --- a/user_guide_src/source/database/results.rst +++ b/user_guide_src/source/database/results.rst @@ -6,7 +6,7 @@ There are several ways to generate query results: .. contents:: :local: - :depth: 2 + :depth: 3 ************* Result Arrays From 3201a02ffa0fc60749ed550a3ab9cecccd7dcd2c Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 25 Mar 2023 13:12:47 +0900 Subject: [PATCH 3/4] docs: add sub section titles --- user_guide_src/source/database/results.rst | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/user_guide_src/source/database/results.rst b/user_guide_src/source/database/results.rst index 2dda585d9b2c..0f64e02c6f3b 100644 --- a/user_guide_src/source/database/results.rst +++ b/user_guide_src/source/database/results.rst @@ -16,13 +16,21 @@ getResult() =========== This method returns the query result as an array of **objects**, or -**an empty array** on failure. Typically you'll use this in a foreach +**an empty array** on failure. + +Getting an Array of stdClass +---------------------------- + +Typically you'll use this in a foreach loop, like this: .. literalinclude:: results/001.php The above method is an alias of ``getResultObject()``. +Getting an Array of Array +------------------------- + You can pass in the string 'array' if you wish to get your results as an array of arrays: @@ -30,6 +38,9 @@ as an array of arrays: The above usage is an alias of ``getResultArray()``. +Getting an Array of Custom Object +--------------------------------- + You can also pass a string to ``getResult()`` which represents a class to instantiate for each result object From e40d25ff231c63ee7dd6d80c5b242bfbf569a53c Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 25 Mar 2023 13:18:30 +0900 Subject: [PATCH 4/4] docs: make method names linkable --- user_guide_src/source/database/results.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/user_guide_src/source/database/results.rst b/user_guide_src/source/database/results.rst index 0f64e02c6f3b..a5d490a81a20 100644 --- a/user_guide_src/source/database/results.rst +++ b/user_guide_src/source/database/results.rst @@ -26,7 +26,7 @@ loop, like this: .. literalinclude:: results/001.php -The above method is an alias of ``getResultObject()``. +The above method is an alias of :php:meth:`CodeIgniter\\Database\\BaseResult::getResultObject()`. Getting an Array of Array ------------------------- @@ -36,7 +36,7 @@ as an array of arrays: .. literalinclude:: results/002.php -The above usage is an alias of ``getResultArray()``. +The above usage is an alias of `getResultArray()`_. Getting an Array of Custom Object --------------------------------- @@ -46,7 +46,7 @@ instantiate for each result object .. literalinclude:: results/003.php -The above method is an alias of ``getCustomResultObject()``. +The above method is an alias of `getCustomResultObject()`_. getResultArray() ================ @@ -283,7 +283,7 @@ Class Reference Returns the query results as an array of rows, where each row is an object of type ``stdClass``. - Usage: see `Result Arrays`_. + Usage: see `Getting an Array of stdClass`_. .. php:method:: getCustomResultObject($class_name)