1 | <?php |
||
26 | abstract class AbstractEditableRepository extends AbstractRepository implements EditableRepository |
||
27 | { |
||
28 | /** |
||
29 | * @var ChangeStream |
||
30 | */ |
||
31 | private $changeStream; |
||
32 | |||
33 | /** |
||
34 | * Create the repository. |
||
35 | * |
||
36 | * @param ChangeStream|null $changeStream If provided, the repository will log |
||
37 | * resources changes in this change stream. |
||
38 | */ |
||
39 | 886 | public function __construct(ChangeStream $changeStream = null) |
|
43 | |||
44 | /** |
||
45 | * {@inheritdoc} |
||
46 | */ |
||
47 | 105 | public function getVersions($path) |
|
55 | |||
56 | /** |
||
57 | * Stores a version of a resource in the change stream. |
||
58 | * |
||
59 | * @param PuliResource $resource The resource version. |
||
60 | */ |
||
61 | 612 | protected function storeVersion(PuliResource $resource) |
|
67 | |||
68 | /** |
||
69 | * Removes all versions of a resource from the change stream. |
||
70 | * |
||
71 | * @param string $path The Puli path. |
||
72 | */ |
||
73 | 78 | protected function removeVersions($path) |
|
79 | |||
80 | /** |
||
81 | * Clears the change stream. |
||
82 | */ |
||
83 | 128 | protected function clearVersions() |
|
89 | } |
||
90 |