relate API option

This commit is contained in:
Yuri Kuznetsov
2024-02-21 18:12:05 +02:00
parent 16f956bdf8
commit 4dee2ebb15
+3 -3
View File
@@ -1211,7 +1211,7 @@ class Service implements Crud,
$this->getRepository()
->getRelation($entity, $link)
->relate($foreignEntity);
->relate($foreignEntity, null, [SaveOption::API => true]);
}
/**
@@ -1267,7 +1267,7 @@ class Service implements Crud,
$this->getRepository()
->getRelation($entity, $link)
->unrelate($foreignEntity);
->unrelate($foreignEntity, [SaveOption::API => true]);
}
/**
@@ -1512,7 +1512,7 @@ class Service implements Crud,
if ($this->acl->getLevel($foreignEntityType, $accessActionRequired) === AclTable::LEVEL_ALL) {
$this->getRepository()
->getRelation($entity, $link)
->massRelate($query);
->massRelate($query, [SaveOption::API => true]);
return true;
}