@@ -153,24 +153,27 @@ function to_string($arrays, $separation = ',')
153153 }
154154
155155 /**
156- * Creates an database column,
157- * - column, datatype, value/options with the given arguments.
156+ * Creates an database column as:
157+ * - ` column`, data`type`, ... value/options ` arguments` .
158158 *
159- * // datatype are global CONSTANTS and can be written out like:
159+ * // datatype are global ` CONSTANTS` and can be written out like:
160160 * - VARCHAR, 32, notNULL, PRIMARY, SEQUENCE|AUTO, ....
161161 * // SEQUENCE|AUTO constants will replaced with the proper auto sequence for the SQL driver
162162 *
163- * @param string $column|CONSTRAINT, - column name/CONSTRAINT usage for PRIMARY|FOREIGN KEY
164- * @param string $type|$constraintName, - data type for column/primary|foreign constraint name
165- * @param mixed $size|...$primaryForeignKeys,
166- * @param mixed $value, - column should be NULL or NOT NULL. If omitted, assumes NULL
167- * @param mixed $default - Optional. It is the value to assign to the column
163+ * @param string $column | `CONSTRAINT`, - column name/CONSTRAINT usage for PRIMARY|FOREIGN KEY
164+ * @param string $type | constraintName, - data type for column/primary|foreign constraint name
165+ * @param mixed ...$arguments any remainder assignments `ordered` like:
166+ * - @param mixed $size, or/and
167+ * - @param mixed $value, - or/and column should be `NULLS`|`notNULL`. If omitted, assumes `NULLS`
168+ * - @param mixed $default, - or/and Optional. It is the value to assign to the column
169+ * - @param mixed $autoNumber, or/and `AUTO` for vendor's auto numbering
170+ * - @param mixed $primaryForeignKeys | or/and `PRIMARY`|`FOREIGN`
168171 *
169172 * @return string|bool - SQL schema string, or false for error
170173 */
171- function column (string $ column = null , string $ type = null , ...$ args )
174+ function column (string $ column = null , string $ type = null , ...$ arguments )
172175 {
173- return ezSchema::column ($ column , $ type , ...$ args );
176+ return ezSchema::column ($ column , $ type , ...$ arguments );
174177 }
175178
176179 function primary (string $ primaryName , ...$ primaryKeys )
@@ -536,6 +539,42 @@ function getInstance()
536539 return ($ ezInstance instanceof ezQueryInterface) ? $ ezInstance : null ;
537540 }
538541
542+ /**
543+ * Get multiple row result set from the database (previously cached results).
544+ * Returns a multi dimensional array.
545+ *
546+ * Each element of the array contains one row of results and can be
547+ * specified to be either an `object`, `json`, `associative array` or `numerical
548+ * array`.
549+ * - If no results are found then the function returns `false`,
550+ * enabling you to use the function within logic statements such as if.
551+ *
552+ * **OBJECT** - `Returning results as an object` is the quickest way to get and
553+ * display results. It is also useful that you are able to put
554+ * `$object->var` syntax directly inside print statements without
555+ * having to worry about causing php parsing errors.
556+ *
557+ * **ARRAY_A** - `Returning results as an associative array` is useful if you would
558+ * like dynamic access to column names.
559+ *
560+ * **ARRAY_N** - `Returning results as a numerical array` is useful if you are using
561+ * completely dynamic queries with varying column names but still need
562+ * a way to get a handle on the results.
563+ *
564+ * **JSON** - `Returning results as JSON encoded` is useful for any interactive dynamic queries.
565+ *
566+ * @param constant $output Either: `OBJECT`|`ARRAY_A`|`ARRAY_N`|`JSON`
567+ * @param object|null $instance `ez_pdo`|`ez_pgsql`|`ez_sqlsrv`|`ez_sqlite3`|`ez_mysqli`
568+ * @return bool|object|array - results as objects (default)
569+ */
570+ function get_results ($ output = \OBJECT , $ instance = null )
571+ {
572+ $ ezQuery = empty ($ instance ) || !is_object ($ instance ) ? getInstance () : $ instance ;
573+ return ($ ezQuery instanceof ezsqlModelInterface)
574+ ? $ ezQuery ->get_results (null , $ output , false )
575+ : false ;
576+ }
577+
539578 /**
540579 * Clear/unset the global database class instance.
541580 */
@@ -548,12 +587,12 @@ function clearInstance()
548587 }
549588
550589 /**
551- * Clean input of XSS, html, javascript, etc...
590+ * Clean input string of XSS, html, javascript, etc...
552591 * @param string $string
553592 *
554593 * @return string cleaned string
555594 */
556- function cleanInput ( $ string )
595+ function clean_string ( string $ string )
557596 {
558597 return ezQuery::clean ($ string );
559598 }
0 commit comments