-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathStatementRepositoryInterface.php
More file actions
69 lines (63 loc) · 2.46 KB
/
StatementRepositoryInterface.php
File metadata and controls
69 lines (63 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
namespace XApi\Repository\Api;
use Xabbuh\XApi\Common\Exception\NotFoundException;
use Xabbuh\XApi\Model\Actor;
use Xabbuh\XApi\Model\Statement;
use Xabbuh\XApi\Model\StatementId;
use Xabbuh\XApi\Model\StatementsFilter;
/**
* Public API of an Experience API (xAPI) {@link Statement} repository.
*
* @author Christian Flothmann <christian.flothmann@xabbuh.de>
*/
interface StatementRepositoryInterface
{
/**
* Finds a {@link Statement} by id.
*
* @param StatementId $statementId The statement id to filter by
* @param Actor|null $authority (Optional) actor that must be the authority
* of the returned statement
*
* @return Statement The statement
*
* @throws NotFoundException if no Statement with the given UUID does exist
*/
public function findStatementById(StatementId $statementId, Actor $authority = null);
/**
* Finds a voided {@link Statement} by id.
*
* @param StatementId $voidedStatementId The voided statement id to filter
* by
* @param Actor|null $authority (Optional) actor that must be the
* authority of the returned statement
*
* @return Statement The statement
*
* @throws NotFoundException if no voided Statement with the given UUID
* does exist
*/
public function findVoidedStatementById(StatementId $voidedStatementId, Actor $authority = null);
/**
* Finds a collection of {@link Statement Statements} filtered by the given
* criteria.
*
* @param StatementsFilter $criteria The criteria to filter by
* @param Actor|null $authority (Optional) actor that must be the
* authority of the returned statements
*
* @return Statement[] The statements
*/
public function findStatementsBy(StatementsFilter $criteria, Actor $authority = null);
/**
* Writes a {@link Statement} to the underlying data storage.
*
* @param Statement $statement The statement to store
* @param bool $flush Whether or not to flush the managed objects
* immediately (i.e. write them to the data
* storage)
*
* @return StatementId The id of the created Statement
*/
public function storeStatement(Statement $statement, $flush = true);
}