/** * Returns the integer value of the generated identifier for the new object. * Called right after execution of the insert query. * * @param ezcPersistentObjectDefinition $def * @param ezcDbHandler $db * @return int */ public function postSave(ezcPersistentObjectDefinition $def, ezcDbHandler $db) { $id = (int) $db->lastInsertId(); // check that the value was in fact successfully received. if ($db->errorCode() != 0) { return null; } return $id; }