- Completed SQLite pragma's missing code

This commit is contained in:
mcndave committed 2023-10-31 16:11:23 +00:00
1 parent 6c6733b503
commit 953fc35680
3 files changed
+17 -7

No files matched your search

+4 -2
View File
@@ -144,13 +144,15 @@ class Repository
}
}
public function clone(object|array $entity) : bool
public function clone(object|array $entity) : object|false
{
$entity = is_object($entity) ? clone $entity : $entity;
foreach(Ulmus::resolveEntity($this->entityClass)->getPrimaryKeyField() as $key => $field) {
unset($entity->$key);
}
return $this->save($entity);
return $this->save($entity) ? $entity : false;
}
public function save(object|array $entity, ? array $fieldsAndValue = null, bool $replace = false) : bool