1 | <?php |
||
16 | class VersionEngine |
||
17 | { |
||
18 | /** @var Version The version for the request if it can be determined */ |
||
19 | private $version = null; |
||
20 | |||
21 | /** |
||
22 | * DTVersionEngine constructor. The first version will be set as default version. |
||
23 | * |
||
24 | * @param Version[] $versions an array of possible version this data table supports |
||
25 | */ |
||
26 | public function __construct(array $versions) |
||
30 | |||
31 | private function setDefaultVersion(array $versions) |
||
39 | |||
40 | private function setVersionFromRequest(array $versions) |
||
51 | |||
52 | /** |
||
53 | * @return Version Will return the version that is currently selected to handle the request. |
||
54 | */ |
||
55 | public function getVersion() |
||
59 | |||
60 | /** |
||
61 | * @return bool true if one of the versions can handle the request, false otherwise |
||
62 | */ |
||
63 | public function hasVersion() |
||
67 | |||
68 | /** |
||
69 | * @param Version $version The version that should be used in this request. |
||
70 | */ |
||
71 | public function setVersion(Version $version) |
||
75 | } |