-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.php
More file actions
47 lines (39 loc) · 793 Bytes
/
action.php
File metadata and controls
47 lines (39 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* action's base class
*/
abstract class Action {
protected $bundles;
const PROCESSING = 1;
const PAUSE = 2;
const SUCCESS = 3;
const IDLE = 4;
const FAILURE = 0;
protected $STATE_CODE;
function __construct($bundles = null) {
$this->bundles = $bundles;
$this->STATE_CODE = self::IDLE;
}
public function __set($name, $value){
$this->bundles[$name] = $value;
}
public function __get($name){
if (isset($this->$name)) {
return $this->bundles[$name];
} else {
return null;
}
}
public function __isset($name){
if (isset($this->bundles[$name])) {
return true;
} else {
return false;
}
}
public function state(){
return $this->STATE_CODE;
}
abstract public function start(Entity $entity);
}
?>