Automattic\WooCommerce\Database\Migrations

MetaToCustomTableMigrator::get_type_defaults()privateWC 1.0

Helper method to get default value of a type.

Method of the class: 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() code WC 8.7.0

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