Prepare data

@return null
428589
protected function prepareData()
    {
        //Now we have $columns contain all real columns settings

        $columns = $this->getColumnSettings();

        $data = array();
        $header = array();
        $columnExtraRoles = array("annotation", "annotationText", "certainty", "emphasis", "interval", "scope", "style", "tooltip");
        foreach ($columns as $cKey => $cSetting) {
            array_push($header, "" . Utility::get($cSetting, "label", $cKey));
            foreach ($columnExtraRoles as $cRole) {
                if (isset($cSetting[$cRole])) {
                    array_push(
                        $header,
                        array(
                            "role" => $cRole,
                        )
                    );
                }
            }
        }
        array_push($data, $header);

        foreach ($this->dataStore as $row) {
            $gRow = array();
            foreach ($columns as $cKey => $cSetting) {
                $value = $row[$cKey];
                $cType = Utility::get($cSetting, "type", "unknown");
                if ($cType === "number") {
                    $value = floatval($value);
                } else if ($cType === "string") {
                    $value = "$value";
                }
                $fValue = $this->formatValue($value, $cSetting, $row);

                array_push(
                    $gRow,
                    ($fValue === $value)
                    ? $value
                    : array("v" => $value, "f" => $fValue)
                );

                foreach ($columnExtraRoles as $cRole) {
                    if (isset($cSetting[$cRole])) {
                        array_push(
                            $gRow,
                            (gettype($cSetting[$cRole]) == "object") ?
                            $cSetting[$cRole]($row) :
                            $cSetting[$cRole]
                        );
                    }
                }
            }
            array_push($data, $gRow);
        }
        return $data;
    }
849844
protected function prepareData($data)
    {
        $data['auth_key'] = $this->api_key;
        $data['format'] = $this->api_format;
        $data['pretty'] = $this->api_pretty;

        return $data;
    }
152133
public function prepare()
    {
        $id = $this->getAttribute('id');
        $menus = $this->menu['with'] ?? [];
        $parent = $this->getAttribute('position');
        $position = Str::startsWith($parent, '^:') ? $parent.'.' : '^:';

        foreach ((array) $menus as $class) {
            $menu = $this->container->make($class)
                            ->setAttribute('position', "{$position}{$id}")
                            ->prepare();

            if ($menu->passes()) {
                $this->childs[] = $menu;
            }
        }

        $this->name = $id;
        $this->showToUser = $this->passesAuthorization();

        return $this;
    }
715641
public function prepare(string $sql = null)
    {
        $this->sqlQuery = $this->getConnection()->prepare($this->getSql($sql));

        return $this;
    }
67994
protected function prepare()
    {
        /** @var CollectionView $collection */
        $collection = $this->getComponent('collection_view');
        $collection->setData($this->getDataProvider());
        if ($collection->getDataInjector() === null) {
            $collection->setDataInjector($this->makeDataInjector());
        }
        $this->applyOperations();
        $this->hideSubmitButtonIfNotUsed();
    }
76217
public function prepare($content = null)
    {
        is_null($content) || $this->setContent($content);

        $content = $this->getContent();

        $content = $this->arrayToJson($content);

        $content = $this->objectToJson($content);

        $content = $this->printRecursiveNonAlphaNum($content);

        if (! $this->jsonErrors($content)) {
            $this->header('Content-Type: application/json');
        }

        $this->setContent($content);

        return $this;
    }
1184642
protected function getData() {
        $data = Input::all();
        if (is_array($data)) {
            return $this->excludeKeys($data);
        } else {
            return null;
        }
    }
197851
protected function prepareDataProvider()
    {
        $requestParams = Yii::$app->getRequest()->getBodyParams();
        if (empty($requestParams)) {
            $requestParams = Yii::$app->getRequest()->getQueryParams();
        }
        
        $filter = null;
        if ($this->dataFilter !== null) {
            $this->dataFilter = Yii::createObject($this->dataFilter);
            if ($this->dataFilter->load($requestParams)) {
                $filter = $this->dataFilter->build();
                if ($filter === false) {
                    return $this->dataFilter;
                }
            }
        }
        
        $query = call_user_func($this->prepareActiveDataQuery);
        if (!empty($filter)) {
            $query->andWhere($filter);
        }

        $dataProvider = Yii::createObject([
            'class' => ActiveDataProvider::class,
            'query' => $query,
            'pagination' => $this->controller->pagination,
            'sort' => [
                'attributes' => $this->controller->generateSortAttributes($this->controller->model->getNgRestConfig()),
                'params' => $requestParams,
            ],
        ]);

        if ($this->isCachable() && $this->controller->cacheDependency) {
            Yii::$app->db->cache(function () use ($dataProvider) {
                $dataProvider->prepare();
            }, 0, Yii::createObject($this->controller->cacheDependency));
        }

        return $dataProvider;
    }
196328
public function prepareData($data = [])
    {
        return (array) ($this->data instanceof Closure ? call_user_func($this->data, $this, $data) : $this->data);
    }
501488
public function prepareForView()
    {
        $formData = [];
        foreach ($this->fieldsets as $fieldset) {
            $formData = array_merge($formData, $fieldset->prepareForView());
        }
        return $formData;
    }
1201759
private function prepare()
    {
        $constantParameters = $this->uriParser->predefinedParameters();
        array_map([$this, 'prepareConstant'], $constantParameters);

        $this->filter();
        $this->sort();

        return $this;
    }
1240707
def prepare_data(self, data=None):
        '''
        
        '''
        data = data or self.export_data(native=True)
        # make sure we don't persist a null _id and let MongoDB auto-generate it
        if '_id' in data and data['_id'] is None:
            del data['_id']
        return data
1059220
public function prepare()
    {
        if ($this->excel === null) {
            $this->excel = new PHPExcel();
        }

        if ($this->header !== null) {
            $this->writeItem($this->header);
        }
    }
1118601
protected function prepare() {
		$c = CF::s($m = $this->m(), Card::create($m, $this->cardData())); /** @var CF $c */ /** @var M $m */
		$this->siID();
		$this->si($this->extended('Card Number', 'Number'), $c->label());
		$c->c()->owner() ? $this->siEx('Cardholder', $c->c()->owner()) : null;
		$this->siEx(['Card Expires' => $c->exp(), 'Card Country' => $c->country()]);
	}
952098
public function prepare ()
		{
			if (is_array($this->viewData)) {
				foreach ($this->viewData as $_token => $_value) {
					if (is_object($_value) && is_subclass_of($_value, __CLASS__)) {
						$$_token = $_value->prepare();
					} else {
						$$_token = $_value;
					}
				}
			}

			if (is_file($this->filePath)) {
				ob_start();
				require($this->filePath);

				return ob_get_clean();

			} else {
				throw new ViewFileNotFoundException('No such view: ' . $this->filePath);
			}
		}
656064
protected function prepare()
    {
        $this
            ->getSession()
            ->getConnection()
            ->sendPrepareQuery(
                $this->getClientIdentifier(),
                $this->orderParameters($this->sql)
            );
        $this->is_prepared = true;

        return $this;
    }
270097
public function prepareVars()
    {
        $this->vars['name'] = $this->getFieldName();
        $this->vars['value'] = $value = $this->getLoadValue();
        $this->vars['availableColors'] = $availableColors = $this->getAvailableColors();
        $this->vars['allowEmpty'] = $this->allowEmpty;
        $this->vars['showAlpha'] = $this->showAlpha;
        $this->vars['isCustomColor'] = !in_array($value, $availableColors);
    }