Jira issue originally created by user bigfootdd:
I'm using "doctrine/orm": v2.5.0 and have simple_array type.
If I persist the class where the property with type simple_array is empty array() the query fails.
I'm coming with solution, please see the github PR https://github.com/doctrine/dbal/pull/877
Comment created by bigfoot:
I've mapped the field as nullable=false, so it should never be null.
If you cannot merge this quickly, you should at least add an warning in the docs saying that the field must be mapped set as nullable.
As alternative, I put filter in getter and setter methods:
public function setFields(array $values): void
{
$this->fields = array_filter($values) ?: [null];
}
public function getFields(): array
{
return array_filter($this->fields);
}
Note: It obviously doesn't work if you want to store empty values
Most helpful comment
Comment created by bigfoot:
I've mapped the field as nullable=false, so it should never be null.
If you cannot merge this quickly, you should at least add an warning in the docs saying that the field must be mapped set as nullable.