1 | <?php |
||
27 | class LogoutOperation extends Operation |
||
28 | { |
||
29 | use PrototypedBindings; |
||
30 | |||
31 | /** |
||
32 | * Returns the record of the user to logout. |
||
33 | * |
||
34 | * The current user is returned. |
||
35 | */ |
||
36 | protected function lazy_get_record() |
||
40 | |||
41 | /** |
||
42 | * Adds the {@link CONTROL_RECORD} control. |
||
43 | */ |
||
44 | protected function get_controls() |
||
45 | { |
||
46 | return [ |
||
47 | |||
48 | self::CONTROL_RECORD => true |
||
49 | |||
50 | ] + parent::get_controls(); |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * Always returns `true`. |
||
55 | * |
||
56 | * @inheritdoc |
||
57 | */ |
||
58 | protected function validate(ErrorCollection $errors) |
||
62 | |||
63 | /** |
||
64 | * Logs out the user. |
||
65 | * |
||
66 | * The {@link logout()} method of the user is invoked to log the user out. |
||
67 | * |
||
68 | * The location of the response can be defined by the `continue` request parameter or the request referer, or '/'. |
||
69 | */ |
||
70 | protected function process() |
||
79 | } |
||
80 |