/**
  *  HTTP GET handler for /Nodes/Get/
  *  Get a graph node by identifier.
  *
  *  Renders \NetAssist\Graph\Node into JSON or sends JSON status response with HTTP status code.
  *
  *  @param int $id Identifier of graph node to render
  */
 public function getAction($id)
 {
     $id = intval($id);
     //disable view rendering, we render JSON
     $this->view->setRenderLevel(View::LEVEL_NO_RENDER);
     //get node from repository by identifier
     $node = $this->_nodesRepo->GetById($id);
     if ($node == null) {
         return $this->sendJsonResponse(['status' => 'Not found', 'code' => 404, 'id' => $id], 404);
     }
     $this->sendJsonResponse($node);
 }
 /**
  *  Handles HTTP GET /Links/Get/ requests.
  *  Get graph link by identifier.
  *
  *  Renders \NetAssist\Graph\Link into JSON or sends JSON state response (with HTTP code) in case of error.
  *  @param int $id Identifier of graph node
  */
 public function getAction($id)
 {
     $id = intval($id);
     //disable view rendering, we render JSON
     $this->view->setRenderLevel(View::LEVEL_NO_RENDER);
     //get link from repository by id
     $link = $this->_linksRepo->GetById($id);
     if ($link == null) {
         //if node not found, send HTTP 404 and JSON response
         return $this->sendJsonResponse(['status' => 'Not found', 'code' => 404, 'id' => $id], 404);
     }
     //send link as JSON
     $this->sendJsonResponse($link);
 }