item->delete() do not allow me to delete a row from DB.
- DB Permissions are correct.
- Phalcon version (3.0.3)
DDL:
CREATE TABLE `z_cb_colors` (
`color_id` int(11) NOT NULL AUTO_INCREMENT,
`description` varchar(128) DEFAULT NULL,
PRIMARY KEY (`color_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
i do a simple test:
$item = ZCbColors::findFirst(7); // this return model with color_id 7
$item->getColorId() // this return number 7
$item->delete(); // this throws ->Cannot delete the record because the primary key attribute: 'color_id' wasn't set
idk why is this happening...
EDIT:
-
if i debug, $item has color_id = 7
- if i call ->jsonserialize() color_id is null