PageRenderTime 82ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/Ezer/engine/process/xml/case/Ezer_XmlSequenceInstance.php

http://ezerphp.googlecode.com/
PHP | 54 lines | 24 code | 6 blank | 24 comment | 2 complexity | 3d12ec07f7ffafce567be2c5dc5aba87 MD5 | raw file
  1. <?php
  2. /**
  3. * This library is free software; you can redistribute it and/or
  4. * modify it under the terms of the GNU Lesser General Public
  5. * License as published by the Free Software Foundation; either
  6. * version 2.1 of the License, or (at your option) any later version.
  7. *
  8. * This library is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. * Lesser General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Lesser General Public
  14. * License along with this library; if not, write to the Free Software
  15. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. *
  17. * For questions, help, comments, discussion, etc., please send
  18. * e-mail to johnathan.kanarek@gmail.com
  19. */
  20. /**
  21. * Purpose: Stores a single instance for the execution of a sequence for a specified case
  22. * @author Tan-Tan
  23. * @package Engine
  24. * @subpackage Process.Case
  25. */
  26. class Ezer_XmlSequenceInstance extends Ezer_SequenceInstance
  27. {
  28. public function __construct(Ezer_ScopeInstance &$scope_instance, Ezer_Sequence $sequence)
  29. {
  30. $id = uniqid('i_');
  31. parent::__construct($id, $scope_instance, $sequence);
  32. }
  33. public function getFullStatus()
  34. {
  35. $data = array(
  36. 'sequence-instance' => array(
  37. 'status' => $this->getStatus(),
  38. 'steps' => null,
  39. )
  40. );
  41. if($this->step_instances && is_array($this->step_instances))
  42. {
  43. foreach($this->step_instances as $step_instance)
  44. $data['sequence-instance']['steps'][] = $step_instance->getFullStatus();
  45. }
  46. return $data;
  47. }
  48. }