GearmanWorkStartingEvent.php 928 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * Gearman Bundle for Symfony2
  4. *
  5. * For the full copyright and license information, please view the LICENSE
  6. * file that was distributed with this source code.
  7. *
  8. * Feel free to edit as you please, and have fun.
  9. *
  10. * @author Marc Morera <yuhu@mmoreram.com>
  11. */
  12. namespace Mmoreram\GearmanBundle\Event;
  13. use Symfony\Component\EventDispatcher\Event;
  14. /**
  15. * GearmanWorkStartingEvent
  16. *
  17. * @author David Moreau <dmoreau@lafourchette.com>
  18. */
  19. class GearmanWorkStartingEvent extends Event
  20. {
  21. /**
  22. * @var array
  23. *
  24. * Gearman jobs running
  25. */
  26. protected $jobs;
  27. /**
  28. * Construct method
  29. *
  30. * @param array $jobs Jobs
  31. */
  32. public function __construct(array $jobs)
  33. {
  34. $this->jobs = $jobs;
  35. }
  36. /**
  37. * Get Gearman Work subscribed jobs
  38. *
  39. * @return array Subscribed jobs
  40. */
  41. public function getJobs()
  42. {
  43. return $this->jobs;
  44. }
  45. }