WPSEO_Database_Proxy::__construct()publicYoast 1.0

Sets the class attributes and registers the table.

Метод класса: WPSEO_Database_Proxy{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$WPSEO_Database_Proxy = new WPSEO_Database_Proxy();
$WPSEO_Database_Proxy->__construct( $database, $table_name, $suppress_errors, $is_multisite_table );
$database(wpdb) (обязательный)
The database object.
$table_name(строка) (обязательный)
The table name that is represented.
$suppress_errors(true|false)
Should the errors be suppressed.
По умолчанию: true
$is_multisite_table(true|false)
Should the table be global in multisite.
По умолчанию: false

Код WPSEO_Database_Proxy::__construct() Yoast 22.3

public function __construct( $database, $table_name, $suppress_errors = true, $is_multisite_table = false ) {
	$this->table_name         = $table_name;
	$this->suppress_errors    = (bool) $suppress_errors;
	$this->is_multisite_table = (bool) $is_multisite_table;
	$this->database           = $database;

	// If the table prefix was provided, strip it as it's handled automatically.
	$table_prefix = $this->get_table_prefix();
	if ( ! empty( $table_prefix ) && strpos( $this->table_name, $table_prefix ) === 0 ) {
		$this->table_prefix = substr( $this->table_name, strlen( $table_prefix ) );
	}

	if ( ! $this->is_table_registered() ) {
		$this->register_table();
	}
}