Пример #1
0
 /**
  * @param int $stageId
  * @return StageRecord
  * @throws \RuntimeException
  */
 protected function createInternalStage($stageId)
 {
     $stageId = (int) $stageId;
     if (!isset($this->internalStages[$stageId])) {
         throw new \RuntimeException('Invalid internal stage "' . $stageId . '"', 1476048246);
     }
     $record = ['uid' => $stageId, 'title' => static::getLanguageService()->sL($this->internalStages[$stageId]['label'])];
     $fieldNamePrefix = $this->internalStages[$stageId]['name'] . '_';
     foreach ($this->internalStageFieldNames as $fieldName) {
         $record[$fieldName] = $this->record[$fieldNamePrefix . $fieldName];
     }
     $stage = StageRecord::build($this, $stageId, $record);
     $stage->setInternal(true);
     return $stage;
 }