We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fb611b6 commit 9013d6eCopy full SHA for 9013d6e
1 file changed
dbObject.php
@@ -268,8 +268,12 @@ public function update ($data = null) {
268
* @return mixed insert id or false in case of failure
269
*/
270
public function save ($data = null) {
271
- if ($this->isNew)
272
- return $this->insert();
+ if ($this->isNew) {
+ $id = $this->insert();
273
+ if (isset ($this->primaryKey))
274
+ $this->data[$this->primaryKey] = $id;
275
+ return $id;
276
+ }
277
return $this->update($data);
278
}
279
0 commit comments