1 | <?php |
||
19 | class WordPoints_Hook_Event_Args extends WordPoints_Entity_Hierarchy { |
||
20 | |||
21 | /** |
||
22 | * Whether the event is repeatable. |
||
23 | * |
||
24 | * @since 1.0.0 |
||
25 | * |
||
26 | * @var bool |
||
27 | */ |
||
28 | protected $is_repeatable = true; |
||
29 | |||
30 | /** |
||
31 | * The validator associated with the current hook reaction. |
||
32 | * |
||
33 | * @since 1.0.0 |
||
34 | * |
||
35 | * @var WordPoints_Hook_Reaction_Validator |
||
36 | */ |
||
37 | protected $validator; |
||
38 | |||
39 | /** |
||
40 | * Whether to push fields onto the validator when we descend into the hierarchy. |
||
41 | * |
||
42 | * This will usually be true, however, when we are getting a value from the |
||
43 | * hierarchy, we aren't actually descending into a sub-field, but descending |
||
44 | * down the arg hierarchy stored within a field. |
||
45 | * |
||
46 | * @since 1.0.0 |
||
47 | * |
||
48 | * @var bool |
||
49 | */ |
||
50 | protected $push_on_descend = true; |
||
51 | |||
52 | /** |
||
53 | * Construct the object with the arg objects. |
||
54 | * |
||
55 | * @param WordPoints_Hook_Arg[] $args The hook args. |
||
56 | */ |
||
57 | public function __construct( array $args ) { |
||
75 | |||
76 | /** |
||
77 | * Whether the event is repeatable. |
||
78 | * |
||
79 | * An event is repeatable if none of its args have their status toggled by the |
||
80 | * event. In that case, it is possible for the event to occur with those same args |
||
81 | * multiple times in a row without being reversed in between. |
||
82 | * |
||
83 | * An arg that has its status modified is called a signature arg. One that does |
||
84 | * not is called a stateful arg. An event is repeatable if it has no signature |
||
85 | * args, only stateful ones. |
||
86 | * |
||
87 | * @since 1.0.0 |
||
88 | * |
||
89 | * @return bool Whether the event is repeatable. |
||
90 | */ |
||
91 | public function is_event_repeatable() { |
||
94 | |||
95 | /** |
||
96 | * Set the validator for the current reaction. |
||
97 | * |
||
98 | * @since 1.0.0 |
||
99 | * |
||
100 | * @param WordPoints_Hook_Reaction_Validator $validator The validator. |
||
101 | */ |
||
102 | public function set_validator( WordPoints_Hook_Reaction_Validator $validator ) { |
||
105 | |||
106 | /** |
||
107 | * @since 1.0.0 |
||
108 | */ |
||
109 | public function descend( $child_slug ) { |
||
154 | |||
155 | /** |
||
156 | * @since 1.0.0 |
||
157 | */ |
||
158 | public function ascend() { |
||
168 | |||
169 | /** |
||
170 | * @since 1.0.0 |
||
171 | */ |
||
172 | public function get_from_hierarchy( array $hierarchy ) { |
||
180 | } |
||
181 | |||
183 |