Return the nodes which refer to the structure with the
given UUID.
public getReferences ( string $uuid ) : PHPCR\NodeInterface[] | ||
$uuid | string | |
return | PHPCR\NodeInterface[] |
/** * Deletes an existing Snippet. * * @param Request $request * @param string $uuid * * @return JsonResponse */ public function deleteSnippetAction(Request $request, $uuid) { $webspaceKey = $request->query->get('webspace', null); $references = $this->snippetRepository->getReferences($uuid); if (count($references) > 0) { $force = $request->headers->get('SuluForceRemove', false); if ($force) { $this->contentMapper->delete($uuid, $webspaceKey, true); } else { return $this->getReferentialIntegrityResponse($webspaceKey, $references); } } else { $this->contentMapper->delete($uuid, $webspaceKey); } return new JsonResponse(); }
public function testGetReferences() { $res = $this->snippetRepository->getReferences($this->hotel1->getUuid()); $this->assertCount(1, $res); }