1 | <?php |
||
18 | class JobStepResponse { |
||
19 | |||
20 | /** |
||
21 | * Description fo what happened during this step |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $_update_text; |
||
25 | |||
26 | /** |
||
27 | * |
||
28 | * @var JobParameters |
||
29 | */ |
||
30 | protected $_job_parameters; |
||
31 | |||
32 | /** |
||
33 | * Extra data to include as part of the response. |
||
34 | * @var array |
||
35 | */ |
||
36 | protected $_extra_data = array(); |
||
37 | |||
38 | |||
39 | |||
40 | /** |
||
41 | * |
||
42 | * @param \EventEspressoBatchRequest\Helpers\JobParameters $job_parameters |
||
43 | * @param string $update_text |
||
44 | * @param array $extra_data |
||
45 | */ |
||
46 | public function __construct(JobParameters $job_parameters, $update_text, $extra_data = array() ) { |
||
51 | |||
52 | |||
53 | |||
54 | /** |
||
55 | * |
||
56 | * @return JobParameters |
||
57 | */ |
||
58 | public function job_parameters() { |
||
61 | |||
62 | |||
63 | |||
64 | /** |
||
65 | * Gets the update_text of what happened in this job during the current step |
||
66 | * @return string |
||
67 | */ |
||
68 | public function update_text() { |
||
71 | |||
72 | |||
73 | |||
74 | /** |
||
75 | * Returns any extra data we may want to include with this response |
||
76 | * @return array |
||
77 | */ |
||
78 | public function extra_data() { |
||
81 | |||
82 | |||
83 | |||
84 | /** |
||
85 | * Converts this response into an array that can be easily serialized. |
||
86 | * This is most useful for serializing or json encoding |
||
87 | * @return array { |
||
88 | * @type string $status, one of JobParameters::valid_stati() |
||
89 | * @type int $units_processed count of units processed |
||
90 | * @type int $job_size total number of units TO process |
||
91 | * @type string $job_id unique string identifying the job |
||
92 | * @type string $update_text string describing what happened during this step |
||
93 | * } and any other items from $this->extra_data() |
||
94 | */ |
||
95 | public function to_array() { |
||
111 | } |
||
112 |