Function Database_Static_xml->_read_all_records

Definitions

sources/database/xml.php

  • Read in all the records from a table.
  • Visibility: protected
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$db array No No required parameter N/A N/A Database connection
$table_name string No No required parameter N/A N/A The table name
$table_as string No No required parameter N/A N/A What the table will be renamed to (blank: N/A)
$schema ?array No No required parameter N/A N/A Schema to type-set against (null: do not do type-setting)
$where_expr ?array No No required parameter N/A N/A Expression filtering results (used for optimisation, seeing if we can get a quick key match) (null: no data to filter with)
$bindings array No No required parameter N/A N/A Bindings available in the execution scope
$fail_ok boolean No No required parameter N/A N/A Whether to not output an error on some kind of run-time failure (parse errors and clear programming errors are always fatal)
$query string No No required parameter N/A N/A Query that was executed
$include_unused_fields boolean No No False N/A N/A Whether to include fields that are present in the actual records but not in our schema
$max ?integer No No Null N/A N/A The maximum number of rows to read (null: no limit / there's a sort clause meaning we need to read all)

Returns

  • The collected records (null: error)
  • Type: ?array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Read in all the records from a table.
 *
 * @param  array $db Database connection
 * @param  string $table_name The table name
 * @param  string $table_as What the table will be renamed to (blank: N/A)
 * @param  ?array $schema Schema to type-set against (null: do not do type-setting)
 * @param  ?array $where_expr Expression filtering results (used for optimisation, seeing if we can get a quick key match) (null: no data to filter with)
 * @param  array $bindings Bindings available in the execution scope
 * @param  boolean $fail_ok Whether to not output an error on some kind of run-time failure (parse errors and clear programming errors are always fatal)
 * @param  string $query Query that was executed
 * @param  boolean $include_unused_fields Whether to include fields that are present in the actual records but not in our schema
 * @param  ?integer $max The maximum number of rows to read (null: no limit / there's a sort clause meaning we need to read all)
 * @return ?array The collected records (null: error)
 */

protected function _read_all_records(array $db, string $table_name, string $table_as, ?array $schema, ?array $where_expr, array $bindings, bool $fail_ok, string $query, bool $include_unused_fields = false, ?int $max = null) : ?array