dbToPhpValue replaces cast and dbValueToPhpValue and supports null values and types.