diff --git a/src/PersistenceModel.php b/src/PersistenceModel.php index c274d89..09db10b 100644 --- a/src/PersistenceModel.php +++ b/src/PersistenceModel.php @@ -375,15 +375,14 @@ protected function deleteByPrimaryKey(array $primary_key_values) { * Updates the model if it exists, * otherwise creates it. * @param PersistentEntity $entity - * @return boolean whether a new row was created + * @return int|false last inserted id if new entity is created, false otherwise */ public function updateOrCreate(PersistentEntity $entity) { if ($this->exists($entity)) { $this->update($entity); - return true; - } else { - $this->create($entity); return false; + } else { + return $this->create($entity); } }