gcdb::process_fields()

最后更新于:2021-11-26 09:03:14

gcdb::process_fields( string$table, array$data, mixed$format)

Processes arrays of field/value pairs and field formats.

参数

$table

(string) (Required) Table name.

$data

(array) (Required) Field/value pair.

$format

(mixed) (Required) Format for each field.

响应

(array|false) An array of fields that contain paired value and formats. False for invalid values.

源文件

文件: gc-includes/gc-db.php

	protected function process_fields( $table, $data, $format ) {
		$data = $this->process_field_formats( $data, $format );
		if ( false === $data ) {
			return false;
		}

		$data = $this->process_field_charsets( $data, $table );
		if ( false === $data ) {
			return false;
		}

		$data = $this->process_field_lengths( $data, $table );
		if ( false === $data ) {
			return false;
		}

		$converted_data = $this->strip_invalid_text( $data );

		if ( $data !== $converted_data ) {
			return false;
		}

		return $data;
	}