Automattic\WooCommerce\Internal\DataStores\Orders
OrdersTableMetaQuery::sanitize_cast_type()
Returns the correct type for a given meta type.
Метод класса: OrdersTableMetaQuery{}
Хуков нет.
Возвращает
Строку
. MySQL type.
Использование
// private - только в коде основоного (родительского) класса $result = $this->sanitize_cast_type( $type ): string;
- $type(строка)
- MySQL type.
По умолчанию: ''
Код OrdersTableMetaQuery::sanitize_cast_type() OrdersTableMetaQuery::sanitize cast type WC 8.1.1
private function sanitize_cast_type( string $type = '' ): string { $meta_type = strtoupper( $type ); if ( ! $meta_type || ! preg_match( '/^(?:BINARY|CHAR|DATE|DATETIME|SIGNED|UNSIGNED|TIME|NUMERIC(?:\(\d+(?:,\s?\d+)?\))?|DECIMAL(?:\(\d+(?:,\s?\d+)?\))?)$/', $meta_type ) ) { return 'CHAR'; } if ( 'NUMERIC' === $meta_type ) { $meta_type = 'SIGNED'; } return $meta_type; }