Prepare step data.

@return mixed
763977
public function prepare()
    {
        $return = [];

        $this->getDatabaseConfigs($return);

        if ($this->command->confirm('Do you want to provide an other user to connect to DB?', false))
        {
            $this->getOtherConnectionUser($return);
        }

        $this->generateSqlCommands($return);

        return $return;
    }
87954
protected function prepare()
    {
        // Set data into dataDocument structure;
        if (is_array($this->data)) {
            foreach ($this->data as $key => $value) {
                $this->addData($key, $value);
            }
        }

     Logger::get()->debug("Response data:\n" . $this->dataDocument->toString(false));

        // Merge data with template.
        $this->document = $this->dataDocument->transform($this->getTemplate());
    }
316669
protected function prepare()
    {
        return [
            'route'             => str_replace(app('url')->to('/'), '', Request::url()),
            'ip_address'        => GeoIPFacade::getClientIP(),
            'user_agent'        => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : 'No UserAgent',
            'created_at'        => new DateTime(),
            'updated_at'        => new DateTime(),
            'type'              => 'dispatched',
            'user_id'           => auth()->guest() ? null : auth()->user()->id,
            'brand_id'          => brand_id(),
            'additional_params' => $this->additionalParams,
            'related_data'      => $this->relatedData
        ];
    }
358295
protected function createStepsFromConfig()
    {
        $config = $this->app['config'];
        $stepClasses = $config->get('setup_wizard.steps');

        if (empty($stepClasses)) throw new \RuntimeException('The setup wizard requires at least 1 step in configuration');

        $steps = [];
        $i = 0;
        foreach ($stepClasses as $id => $stepClass) {
            $s = new $stepClass($id);
            $steps[$id] = $s;
            ++$i;
        }

        return $steps;
    }
258766
public function buildData()
    {
        $options = $this->getOptions();
        
        $total = $this->getCount();
        
        $data  = $this->getResult();
        
        $dataEvent = new DataEvent($this->dataGrid->getName(), $data);
        
        $this->dispatcher
            ->dispatch(DataGridEvents::onDataReady, $dataEvent);
        
        $this->data = $dataEvent->getData();
        
        $rows = array();
        
        if ($options['page'] && $options['records']){
            $total = ceil($this->getCount() / $options['records']);
        }

        foreach ($this->getData() as $row) {
            $colData = array();
            foreach($this->getDataGrid()->getColModel() as $col){
                $colData[] = $row[$col['name']];
            }

            $rows[] = array('id' => $row['id'], 'cell' => $colData);
        }
        
        $processedData =  array(
            'page'    => $options['page'],
            'total'   => (int) $total,
            'records' => $this->getCount(),
            'rows'    => $rows
        );
        
        $this->processedData = $processedData;
        
        return $this;
    }
949839
private function prepare()
    {
        if (!$this->storage->has(self::FLASH_KEY)) {
            $this->storage->set(self::FLASH_KEY, array());
        }
    }
277617
public function getData()
    {
        $this->validateParams();

        $this->setDefaults();

        $this->convertToString();

        $data = $this->parameters->all();

        $data['method'] = $this->method;

        ksort($data);

        $data['sign'] = $this->sign($data, $this->getSignType());

        return $data;
    }
1143404
private function prepareDataBits()
    {
        $n              = $this->structureAppendN;
        $m              = $this->structureAppendM;
        $parity         = $this->structureAppendParity;
        $originalData   = $this->structureAppendOriginalData;

        $dataCounter   = 0;

        if ( $this->checkStructureAppend($n, $m) )
        {
            $dataValue[0]  = 3;
            $dataBits[0]   = 4;

            $dataValue[1]  = $m - 1;
            $dataBits[1]   = 4;

            $dataValue[2]  = $n - 1;
            $dataBits[2]   = 4;

            $originalDataLength = strlen($originalData);

            if ( $originalDataLength > 1 )
            {
                $parity = 0;

                $i      = 0;
                while ($i < $originalDataLength)
                {
                    $parity = ($parity ^ ord(substr($originalData, $i, 1)));
                    $i++;
                }
            }

            $dataValue[3]  = $parity;
            $dataBits[3]   = 8;

            $dataCounter   = 4;
        }

        $dataBits[$dataCounter] = 4;

        return $dataBits;
    }
536630
public function prepare()
    {
        $this->taskFileSystemStack()
             ->mkdir($this->properties['dist.dir'])
             ->mkdir($this->properties['target.dir'])
             ->mkdir(sprintf('%s/reports', $this->properties['target.dir']))
             ->run();
    }
759933
public function getStepAttribute()
    {
        if ($this->attributes['data'] == '' || $this->attributes['type'] != 'number')
            return null;

        $data = unserialize($this->attributes['data']);

        if (!isset($data['step']))
            return null;
        else {
            return $data['step'];
        }
    }
1251835
public function get_data() {
        $data = parent::get_data();
        if (!empty($data->saverubric)) {
            $data->status = gradingform_controller::DEFINITION_STATUS_READY;
        } else if (!empty($data->saverubricdraft)) {
            $data->status = gradingform_controller::DEFINITION_STATUS_DRAFT;
        }
        return $data;
    }
656546
protected function prepareAttributes()
    {

        // prepare the date format for the created at/updated at dates
        $createdAt = $this->getValue(ColumnKeys::CREATED_AT, date('Y-m-d H:i:s'), array($this, 'formatDate'));
        $updatedAt = $this->getValue(ColumnKeys::UPDATED_AT, date('Y-m-d H:i:s'), array($this, 'formatDate'));

        // initialize the product values
        $sku = $this->getValue(ColumnKeys::SKU);
        $productType = $this->getValue(ColumnKeys::PRODUCT_TYPE);

        // load the product's attribute set ID
        $attributeSet = $this->getAttributeSet();
        $attributeSetId = $attributeSet[MemberNames::ATTRIBUTE_SET_ID];

        // return the prepared product
        return $this->initializeEntity(
            array(
                MemberNames::SKU              => $sku,
                MemberNames::CREATED_AT       => $createdAt,
                MemberNames::UPDATED_AT       => $updatedAt,
                MemberNames::HAS_OPTIONS      => 0,
                MemberNames::REQUIRED_OPTIONS => 0,
                MemberNames::TYPE_ID          => $productType,
                MemberNames::ATTRIBUTE_SET_ID => $attributeSetId
            )
        );
    }
859497
public function getStepsArray()
    {
        $steps = null;

        if ($this->getSteps() && $this->getSteps()[0] === '{') {
            $steps = json_decode($this->getSteps(), true);
        } elseif ($this->getSteps()) {
            $steps = explode(',', $this->getSteps());
        }
        if (!$steps) {
            $steps = array('index','play','result','bounce');
        }
        return $steps;
    }
238622
protected function prepare()
    {
        if (!is_array($this->data) || count($this->data) == 0) {
            $this->setData($this->read());
        }
    }
518571
public function build() {
    $route_name = $this->routeMatch->getRouteName();
    if ($route_name !== 'acm_checkout.form') {
      return [];
    }

    // Load the CheckoutFlow plugin.
    $config = \Drupal::config('acm_checkout.settings');
    $checkout_flow_plugin = $config->get('checkout_flow_plugin') ?: 'multistep_default';
    $plugin_manager = \Drupal::service('plugin.manager.acm_checkout_flow');
    $checkout_flow = $plugin_manager->createInstance($checkout_flow_plugin, []);

    // Build the steps sent to the template.
    $steps = [];
    $visible_steps = array_filter($checkout_flow->getVisibleSteps(), function ($step_definition) {
      return (!isset($step_definition['hide_from_progress']));
    });
    $visible_step_ids = array_keys($visible_steps);
    $current_step_id = $checkout_flow->getStepId();
    $current_step_index = array_search($current_step_id, $visible_step_ids);

    // Get last step completed in the cart.
    $cart = $this->cartStorage;
    $cart_step_id = $cart->getCheckoutStep();
    $cart_step_index = array_search($cart_step_id, $visible_step_ids);

    $index = 0;
    foreach ($visible_steps as $step_id => $step_definition) {
      $is_link = FALSE;
      $completed = FALSE;
      if ($index < $current_step_index) {
        $position = 'previous';
      }
      elseif ($index == $current_step_index) {
        $position = 'current';
      }
      else {
        $position = 'next';
      }

      $label = $step_definition['label'];
      // Add a class if this step has been completed already.
      if ($index < $cart_step_index) {
        $completed = TRUE;
      }
      // Set the label to a link if this step has already been completed so that
      // the progress bar can be used as a sort of navigation.
      if ($index <= $cart_step_index && $index !== $current_step_index) {
        $is_link = TRUE;
        $label = Link::createFromRoute($label, 'acm_checkout.form', [
          'step' => $step_id,
        ])->toString();
      }

      $steps[] = [
        'id' => $step_id,
        'label' => $label,
        'position' => $position,
        'completed' => $completed,
        'is_link' => $is_link,
      ];

      $index++;
    }

    return [
      '#attached' => [
        'library' => ['acm_checkout/checkout_progress'],
      ],
      '#theme' => 'acm_checkout_progress',
      '#steps' => $steps,
    ];
  }
466310
public function fetch() {
        $params = Values::of(array());

        $payload = $this->version->fetch(
            'GET',
            $this->uri,
            $params
        );

        return new StepInstance(
            $this->version,
            $payload,
            $this->solution['flowSid'],
            $this->solution['engagementSid'],
            $this->solution['sid']
        );
    }
66747
public function getPreparedData()
    {
        $params = $this->getData();

        if ($this->authorize) {
            $params = array_merge($params, $this->authenticationData($params));
        }

        return $params;
    }