File tree Expand file tree Collapse file tree 4 files changed +87
-0
lines changed Expand file tree Collapse file tree 4 files changed +87
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ protected function allowedMethodsForModels()
7676 'permalink ' ,
7777 'previewUrl ' ,
7878 'url ' ,
79+ 'version '
7980 ];
8081 }
8182
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Kirby \Kql \Interceptors \Content ;
4+
5+ use Kirby \Kql \Interceptor ;
6+
7+ class Lock extends Interceptor
8+ {
9+ public const CLASS_ALIAS = 'lock ' ;
10+
11+ public function allowedMethods (): array
12+ {
13+ return [
14+ 'isActive ' ,
15+ 'isLocked ' ,
16+ 'modified ' ,
17+ 'toArray ' ,
18+ 'user ' ,
19+ ];
20+ }
21+
22+ public function toArray (): array
23+ {
24+ return $ this ->object ->toArray ();
25+ }
26+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Kirby \Kql \Interceptors \Content ;
4+
5+ use Kirby \Kql \Interceptor ;
6+
7+ class Version extends Interceptor
8+ {
9+ public const CLASS_ALIAS = 'version ' ;
10+
11+ protected $ toArray = [
12+ 'content ' ,
13+ 'id ' ,
14+ 'exists ' ,
15+ 'isLatest ' ,
16+ 'lock ' ,
17+ 'modified ' ,
18+ ];
19+
20+ public function allowedMethods (): array
21+ {
22+ return [
23+ 'content ' ,
24+ 'id ' ,
25+ 'exists ' ,
26+ 'isLatest ' ,
27+ 'isLocked ' ,
28+ 'lock ' ,
29+ 'modified ' ,
30+ 'read ' ,
31+ ];
32+ }
33+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Kirby \Kql \Interceptors \Content ;
4+
5+ use Kirby \Kql \Interceptor ;
6+
7+ class VersionId extends Interceptor
8+ {
9+ public const CLASS_ALIAS = 'versionId ' ;
10+
11+ protected $ toArray = [
12+ 'value ' ,
13+ ];
14+
15+ public function allowedMethods (): array
16+ {
17+ return [
18+ 'is ' ,
19+ 'value '
20+ ];
21+ }
22+
23+ public function toResponse ()
24+ {
25+ return $ this ->object ->value ();
26+ }
27+ }
You can’t perform that action at this time.
0 commit comments