This commit is contained in:
mcndave committed 2023-12-04 12:36:20 -05:00
commit fa4e686f35
4 files changed
+38 -24

No files matched your search

+3 -1
View File
@@ -242,7 +242,7 @@ class Repository
$primaryKeyDefinition = Ulmus::resolveEntity($this->entityClass)->getPrimaryKeyField();
if ( $replace || ! $entity->isLoaded() ) {
if ( ! $entity->isLoaded() ) {
# $dataset = array_filter($dataset, fn($item, $field) => ! ($this->entityResolver->searchFieldAnnotation($field, new Field, false)->readonly ?? false), \ARRAY_FILTER_USE_BOTH);
$statement = $this->insertSqlQuery($fieldsAndValue ?? $dataset, $replace)->runInsertQuery();
@@ -277,6 +277,8 @@ class Repository
return $update ? (bool) $update->rowCount : false;
}
}
return 0;
}
public function replace(object|array $entity, ? array $fieldsAndValue = null) : bool