generated from Nodarx/template
feat: entity patch
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -91,6 +91,7 @@ class Service implements ServiceBaseInterface, ServiceMutableInterface, ServiceC
|
||||
self::CAPABILITY_ENTITY_FETCH => true,
|
||||
self::CAPABILITY_ENTITY_CREATE => false,
|
||||
self::CAPABILITY_ENTITY_MODIFY => false,
|
||||
self::CAPABILITY_ENTITY_PATCH => true,
|
||||
self::CAPABILITY_ENTITY_DELETE => true,
|
||||
self::CAPABILITY_ENTITY_MOVE => true,
|
||||
self::CAPABILITY_ENTITY_COPY => false,
|
||||
@@ -631,8 +632,18 @@ class Service implements ServiceBaseInterface, ServiceMutableInterface, ServiceC
|
||||
|
||||
foreach ($targets as $targetCollection => $targetIdentifiers) {
|
||||
$uids = array_keys($targetIdentifiers);
|
||||
$flagsAdd = [];
|
||||
$flagsRemove = [];
|
||||
|
||||
$mutations = $this->mailService->entityPatch($targetCollection, $properties, ...$uids);
|
||||
foreach ($properties->getFlags() as $flag => $value) {
|
||||
if ($value === true) {
|
||||
$flagsAdd[] = $flag;
|
||||
} elseif ($value === false) {
|
||||
$flagsRemove[] = $flag;
|
||||
}
|
||||
}
|
||||
|
||||
$mutations = $this->mailService->entityPatch($targetCollection, $flagsAdd, $flagsRemove, ...$uids);
|
||||
|
||||
foreach ($uids as $uid) {
|
||||
$list[(string)$targetIdentifiers[$uid]] = ['disposition' => 'patched'];
|
||||
|
||||
Reference in New Issue
Block a user