getReferences() public method

Return the nodes which refer to the structure with the given UUID.
public getReferences ( string $uuid ) : PHPCR\NodeInterface[]
$uuid string
return PHPCR\NodeInterface[]
Example #1
0
 /**
  * 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();
 }
Example #2
0
 public function testGetReferences()
 {
     $res = $this->snippetRepository->getReferences($this->hotel1->getUuid());
     $this->assertCount(1, $res);
 }