|
@@ -28,6 +28,13 @@ abstract class AbstractGearmanClientTaskEvent extends Event
|
|
|
*/
|
|
|
protected $gearmanTask;
|
|
|
|
|
|
+ /**
|
|
|
+ * @var mixed
|
|
|
+ *
|
|
|
+ * Context that can be set in the addTask method
|
|
|
+ */
|
|
|
+ protected $context;
|
|
|
+
|
|
|
/**
|
|
|
* Construct method
|
|
|
*
|
|
@@ -47,4 +54,20 @@ abstract class AbstractGearmanClientTaskEvent extends Event
|
|
|
{
|
|
|
return $this->gearmanTask;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param mixed $context Context that can be set in the addTask method
|
|
|
+ */
|
|
|
+ public function setContext($context)
|
|
|
+ {
|
|
|
+ $this->context = &$context['context'];
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return mixed Context that can be set in the addTask method
|
|
|
+ */
|
|
|
+ public function &getContext()
|
|
|
+ {
|
|
|
+ return $this->context;
|
|
|
+ }
|
|
|
}
|