1 <?php
2
3 4 5 6 7 8 9 10
11
12 namespace Icybee\Operation\ActiveRecord;
13
14 use ICanBoogie\Module;
15 use ICanBoogie\Operation;
16
17 18 19
20 class Lock extends Operation
21 {
22 protected function reset()
23 {
24 global $core;
25
26 parent::reset();
27
28 $this->module = $core->modules[$this->request['module']];
29 $this->key = $this->request['key'];
30 }
31
32 protected function get_controls()
33 {
34 return array
35 (
36 self::CONTROL_PERMISSION => Module::PERMISSION_MAINTAIN,
37 self::CONTROL_OWNERSHIP => true
38 )
39
40 + parent::get_controls();
41 }
42
43 protected function validate(\ICanboogie\Errors $errors)
44 {
45 return true;
46 }
47
48 protected function process()
49 {
50 return $this->module->lock_entry((int) $this->key);
51 }
52 }