-
-
Notifications
You must be signed in to change notification settings - Fork 92
Description
Hello,
I am experiencing this issue in projects where my table contains only columns with default values. E.g column ID is autoincrement, CREATED is currenttimestamp() and column DELETED is default 0. I have no need to insert any values to mapper, I just need to insert row. Even if I set this values in mapper to NULL, so $mapper->changed() is TRUE and then use $mapper->insert() or save(), mapper doesn't create record.
Only solution I found is to get DB connection and call $db->exec("INSERT INTO table VALUES(DEFAULT,DEFAULT,DEFAULT)") and then dig into PDO to get inserted ID with $db->pdo()->lastInsertId().
It could be very useful to be able insert such record with mapper directly and then continue with its functionality such as $mapper->_id etc.