Procházet zdrojové kódy

Added context information to event

Michael Sivolobov před 10 roky
rodič
revize
bb9fd57eda
1 změnil soubory, kde provedl 23 přidání a 0 odebrání
  1. 23 0
      Event/Abstracts/AbstractGearmanClientTaskEvent.php

+ 23 - 0
Event/Abstracts/AbstractGearmanClientTaskEvent.php

@@ -28,6 +28,13 @@ abstract class AbstractGearmanClientTaskEvent extends Event
      */
      */
     protected $gearmanTask;
     protected $gearmanTask;
 
 
+    /**
+     * @var mixed
+     *
+     * Context that can be set in the addTask method
+     */
+    protected $context;
+
     /**
     /**
      * Construct method
      * Construct method
      *
      *
@@ -47,4 +54,20 @@ abstract class AbstractGearmanClientTaskEvent extends Event
     {
     {
         return $this->gearmanTask;
         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;
+    }
 }
 }