Automattic\WooCommerce\Database\Migrations
MetaToCustomTableMigrator::get_type_defaults
Helper method to get default value of a type.
Method of the class: MetaToCustomTableMigrator{}
No Hooks.
Returns
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() MetaToCustomTableMigrator::get type defaults code WC 10.6.2
private function get_type_defaults( $type ) {
switch ( $type ) {
case 'float':
case 'int':
case 'decimal':
return 0;
case 'string':
return '';
}
}