ILIAS  trunk Revision v12.0_alpha-1338-g8f7e531aa3c
Factory.php
Go to the documentation of this file.
1<?php
2
20
22
32{
33 public function __construct(
34 private Context $context
35 ) {
36 }
37
47 public function cannot(): CannotHandle
48 {
49 return new CannotHandle();
50 }
51
61 public function cannotReach(): CannotReach
62 {
63 return new CannotReach();
64 }
65
75 {
76 if ($this->context->isUserLoggedIn()) {
77 return $this->cannotReach();
78 }
79
80 return new MaybeCanHandlerAfterLogin();
81 }
82
88 public function can(string $uri_path, bool $shift = false): CanHandleWithURIPath
89 {
90 return new CanHandleWithURIPath($uri_path, $shift ? 1 : 0);
91 }
92}
Returned by a Handler when it has successfully resolved the Request.
Returned by a Handler when it cannot process the given Request at all, e.g.
Returned by a Handler when the target exists but the CURRENT (logged-in) user has no permission to re...
Definition: CannotReach.php:35
loginFirst()
Convenience: the Handler cannot serve the target with the current permissions.
Definition: Factory.php:74
__construct(private Context $context)
Definition: Factory.php:33
cannotReach()
The target exists, but the CURRENT user has no permission to reach it.
Definition: Factory.php:61
can(string $uri_path, bool $shift=false)
The Handler successfully resolved the target.
Definition: Factory.php:88
cannot()
The Handler cannot process the given Request at all, e.g.
Definition: Factory.php:47
Returned when the target is (or might be) reachable after the user logs in.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...