-Empty dataset can not be saved
This commit is contained in:
1 parent
11e436236c
commit
36162c6486
2 files changed
+9
-1
No files matched your search
@@ -199,6 +199,10 @@ class Repository implements RepositoryInterface
|
||||
if ( $replace || ! $entity->isLoaded() ) {
|
||||
# $dataset = array_filter($dataset, fn($item, $field) => ! ($this->entityResolver->searchFieldAnnotation($field, new Field, false)->readonly ?? false), \ARRAY_FILTER_USE_BOTH);
|
||||
|
||||
if (empty($dataset)) {
|
||||
throw new \InvalidArgumentException("Unable to add a new row from an empty dataset.");
|
||||
}
|
||||
|
||||
$pdoObject = $this->insertSqlQuery($fieldsAndValue ?? $dataset, $replace)->runInsertQuery();
|
||||
|
||||
if ( null !== $primaryKeyDefinition ) {
|
||||
|
||||
Reference in new issue
Block a user