Automattic\WooCommerce\Database\Migrations

MetaToCustomTableMigrator::get_type_defaults()privateWC 1.0

Helper method to get default value of a type.

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

No Hooks.

Return

Mixed. Default value.

Usage

// private - for code of main (parent) class only
$result = $this->get_type_defaults( $type );
$type(string) (required)
Type.

Код MetaToCustomTableMigrator::get_type_defaults() WC 7.1.0

private function get_type_defaults( $type ) {
	switch ( $type ) {
		case 'float':
		case 'int':
			return 0;
		case 'string':
			return '';
	}
}