コード例 #1
0
ファイル: ActivityTask.php プロジェクト: evilfirefox/swf-w
 public function initFromArray(array $source)
 {
     parent::initFromArray($source);
     $this->activityId = $source[static::INDEX_ACTIVITY_ID];
     $this->input = $source[static::INDEX_INPUT];
     $this->activityType = new ActivityType();
     $this->activityType->initFromArray($source);
 }
コード例 #2
0
 /**
  * @param array $source
  * @return mixed
  */
 public function initFromArray(array $source)
 {
     if (!array_key_exists(static::INDEX_SCHEDULE_ACTIVITY_TASK_DECISION_ATTRIBUTE, $source)) {
         return;
     }
     $source = $source[static::INDEX_SCHEDULE_ACTIVITY_TASK_DECISION_ATTRIBUTE];
     $this->activityId = $source[static::INDEX_ACTIVITY_ID];
     $this->control = $source[static::INDEX_CONTROL];
     $this->input = $source[static::INDEX_INPUT];
     $this->heartbeatTimeout = $source[static::INDEX_HEARTBEAT_TIMEOUT];
     $this->scheduleToCloseTimeout = $source[static::INDEX_SCHEDULE_TO_CLOSE_TIMEOUT];
     $this->scheduleToStartTimeout = $source[static::INDEX_SCHEDULE_TO_START_TIMEOUT];
     $this->taskPriority = $source[static::INDEX_TASK_PRIORITY];
     $this->startToCloseTimeout = $source[static::INDEX_START_TO_CLOSE_TIMEOUT];
     $this->activityType = new ActivityType();
     $this->activityType->initFromArray($source);
     $this->taskList = new TaskList();
     $this->taskList->initFromArray($source);
     $this->isEmpty = false;
 }
コード例 #3
0
 public function initFromArrayDataProvider()
 {
     $request = json_decode($this->loadFixture(static::FILE_FIXTURE_REQUEST), true);
     $source = $request[ScheduleActivityTaskDecisionAttributes::INDEX_SCHEDULE_ACTIVITY_TASK_DECISION_ATTRIBUTE];
     $expectation = new ScheduleActivityTaskDecisionAttributes();
     $expectation->setActivityId('verification-27');
     $activityType = new ActivityType();
     $activityType->initFromArray($source);
     $expectation->setActivityType($activityType);
     $expectation->setControl('digital music');
     $expectation->setHeartbeatTimeout('120');
     $expectation->setInput('5634-0056-4367-0923,12/12,437');
     $expectation->setScheduleToCloseTimeout('900');
     $expectation->setScheduleToStartTimeout('300');
     $expectation->setStartToCloseTimeout('600');
     $taskList = new TaskList();
     $taskList->initFromArray($source);
     $expectation->setTaskList($taskList);
     $expectation->setTaskPriority('100');
     $expectation->setIsEmpty(false);
     return array(array('success' => array(static::INDEX_INPUT => $request, static::INDEX_EXPECTATION => $expectation)));
 }