ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
GetRevisionTrait.php
Go to the documentation of this file.
1<?php
2
20
22use OutOfBoundsException;
23
28trait GetRevisionTrait
29{
33 protected function getRevision(): Revision
34 {
35 if ($this->revision_number !== null) {
36 if ($this->resource->hasSpecificRevision($this->revision_number)) {
37 $revision = $this->resource->getSpecificRevision($this->revision_number);
38 } else {
39 throw new OutOfBoundsException(
40 "there is no version $this->revision_number of resource {$this->resource->getIdentification()->serialize()}"
41 );
42 }
43 } else {
44 $revision = $this->resource->getCurrentRevision();
45 }
46 return $revision;
47 }
48}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...