Skip to content

Commit

Permalink
add createVersion method and interface
Browse files Browse the repository at this point in the history
  • Loading branch information
elizoller committed May 21, 2019
1 parent fc60e9c commit 60905be
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/FedoraApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,4 +305,24 @@ public function getGraph(ResponseInterface $response)
}
return $graph;
}

/**
* Creates version in Fedora.
* @param string $uri Resource Versions URI
* @param array $header HTTP Headers
*
* @return ResponseInterface
*/
public function createVersion(
$uri = '',
$headers = []
) {
$options = ['http_errors' => false, 'headers' => $headers];

return $this->client->request(
'POST',
$uri,
$options
);
}
}
12 changes: 12 additions & 0 deletions src/IFedoraApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,16 @@ public function saveGraph(
$uri = "",
$headers = []
);

/**
* Creates a version of the resource in Fedora.
*
* @param string $uri Resource URI
* @param array $headers HTTP Headers
* @return \Psr\Http\Message\ResponseInterface
*/
public function createVersion(
$uri = "",
$headers = []
);
}

0 comments on commit 60905be

Please sign in to comment.