/** * @param \Netlogix\JsonApiOrg\ExampleData\Domain\Dto\NodeResource $node */ public function createAction(\Netlogix\JsonApiOrg\ExampleData\Domain\Dto\NodeResource $node) { $this->nodeRepository->add($node->getPayload()); $this->response->setStatus(201); $this->response->setHeader('Content-Location', $node->getLinks()['self']); $this->forward('show', NULL, NULL, array('node' => $node->getPayload())); }
/** * Removes all nodes from the repository */ public function pruneCommand() { $this->nodeRepository->removeAll(); }