-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Labels
Milestone
Description
I faced this issue multiple times already. You can work around this issue but I think it should be a part of the ORM.
Table:
CREATE TABLE categories
(
id INTEGER PRIMARY KEY NOT NULL,
name VARCHAR(128) NOT NULL,
meta_title VARCHAR(255)
);
ORM usage:
$entity = $this->Categories->newEntity($this->request->data);
$this->Categories->save($entity);
Current result:
| id | name | meta_title |
|---|---|---|
| 1 | Test |
Should be:
| id | name | meta_title |
|---|---|---|
| 1 | Test | NULL |
As I mentioned above you can work around this behavior with Behaviors/Callbacks but I think this should be something which is handled directly inside the ORM. Saving an empty string inside a NULLable field isn't the proper usage of NULL.
inoas, thinkingmedia, Kareylo, davidyell, ogrrd and 4 more