19 declare(strict_types=1);
49 if ($this->identification->serialize() !== $revision->
getIdentification()->serialize()) {
51 "Can't add Revision since it's not the same ResourceIdentification" 54 foreach ($this->revisions as $r) {
58 "Can't add already existing version number: %s",
65 asort($this->revisions);
68 public function remove(
Revision $revision):
void 70 foreach ($this->revisions as $k => $revision_e) {
71 if ($revision->getVersionNumber() === $revision_e->getVersionNumber()) {
72 unset($this->revisions[$k]);
81 foreach ($this->revisions as $k => $revision_e) {
83 $this->revisions[$k] = $revision;
90 $this->revisions = [];
91 $this->
add($revision);
96 $v = array_values($this->revisions);
116 if ($this->revisions === []) {
119 return max(array_keys($this->revisions));
replaceAllRevisions(Revision $revision)
replaceSingleRevision(Revision $revision)
ResourceIdentification $identification
__construct(ResourceIdentification $identification, array $revisions=[])
RevisionCollection constructor.
Class RevisionCollection.
Class ResourceIdentification.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...