Skip to content
Open

Fixes #126

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private function removeDataFromCache(\MongoDB\Collection $collection, string $ty
$endpoints = $collection->find()->toArray();
foreach ($endpoints as $endpoint) {
if (!$this->entityManager->find($type, $endpoint['id'])) {
$this->io->writeln("removing {$endpoint['id']} from cache");
isset($this->io) && $this->io->writeln("removing {$endpoint['id']} from cache");
$collection->findOneAndDelete(['id' => $endpoint['id']]);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ public function getId(array $object)
} elseif (isset($this->data['query']['id'])) {
return $this->data['query']['id'];
} elseif (isset($this->data['path']['id'])) {
return$this->data['path']['id'];
return $this->data['path']['id'];
} elseif (isset($this->data['path']['{uuid}'])) {
return $this->data['path']['{uuid}'];
} elseif (isset($this->data['query']['uuid'])) {
return$this->data['query']['uuid'];
return $this->data['query']['uuid'];
} elseif (isset($this->content['id'])) { // the id might also be passed trough the object itself
return $this->content['id'];
} elseif (isset($this->content['uuid'])) {
Expand Down Expand Up @@ -544,6 +544,8 @@ public function requestHandler(array $data, array $configuration): Response
if (isset($eventType) && isset($this->object)) {
$event = new ActionEvent($eventType, ['response' => $this->object->toArray(), 'entity' => $this->object->getEntity()->getId()->toString()]);
$this->eventDispatcher->dispatch($event, $event->getType());
$eventData = $event->getData();
isset($eventData['response']) && $result = $eventData['response'];
}

$this->handleMetadataSelf($result, $metadataSelf);
Expand Down