Function DatabaseConnector->get_table_count_approx

Definitions

sources/database.php

  • Get the number of rows in a table, with approximation support for performance (if necessary on the particular database backend).
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: int

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$table string No No required parameter N/A N/A The table name
$where array No No [] N/A N/A WHERE clauses if it will help get a more reliable number when we're not approximating in map form
$where_clause ?string No No Null N/A N/A WHERE clauses if it will help get a more reliable number when we're not approximating in SQL form (null: none)

Returns

  • The count (null: do it normally)
  • Type: ?integer
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get the number of rows in a table, with approximation support for performance (if necessary on the particular database backend).
 *
 * @param  string $table The table name
 * @param  array $where WHERE clauses if it will help get a more reliable number when we're not approximating in map form
 * @param  ?string $where_clause WHERE clauses if it will help get a more reliable number when we're not approximating in SQL form (null: none)
 * @return ?integer The count (null: do it normally)
 */

public function get_table_count_approx(string $table, array $where = [], ?string $where_clause = null) : ?int