Closed lunika closed 7 years ago
Here is the raw result of the complex query
Unfortunately this is because the converter uses PHP’s str_getcsv()
function in the EntityConverter
. This builtin function implement the RFC4180 which has been made to convert CSV to ms-application/excel
mime type. This RFC states all fieds are strings hence empty values are treated as empty strings (except for `str_getcsv('') which returns null, see this discussion about it).
The only way I see to circumvent this problem would be to re-implement a finite-state CSV parser in PHP that would probably ruin all performance benefits.
Thanks for you answer. For this case I can use a work around and test if the value is empty
instead of NULL
. It can be NULL
or a valid uuid
. But your information is good to know :+1:
I have a special case where a
<null>
value in my database is cast as an empty string in my entity. But it's not always the case, it only happens when the entity is loaded from a complex queryOn the screenshot it is the
subscription_history
table. The result is this one :and in my database I have this value
the
origin
field isnull
but I have an empty string here. When I load thissubscription_history
record in a simple query (directly fron theSubscriptionHistoryModel
I have no error.I don't know if it's a foudation or model manager issue