prepareData

@param array $pluginData

@return array
489873
public function prepareData($pluginData = [])
    {
        // Data migration of alternate keys
        if (!isset($pluginData['layoutContainer'])
            && array_key_exists(
                'containerName',
                $pluginData
            )
        ) {
            $pluginData['layoutContainer'] = $pluginData['containerName'];
        }

        if (!isset($pluginData['renderOrder'])
            && array_key_exists(
                'rank',
                $pluginData
            )
        ) {
            $pluginData['renderOrder'] = $pluginData['rank'];
        }

        // Defaults
        if (!isset($pluginData['layoutContainer'])) {
            $pluginData['layoutContainer'] = null;
        }

        // @deprecated <deprecated-site-wide-plugin>
        if (!isset($pluginData['siteWide'])) {
            $pluginData['siteWide'] = 0;
        }

        if (!isset($pluginData['renderOrder'])) {
            $pluginData['renderOrder'] = 0;
        }

        /** @var \Rcm\Repository\PluginInstance $pluginInstanceRepo */
        $pluginInstanceRepo = $this->_em->getRepository(
            \Rcm\Entity\PluginInstance::class
        );

        return $pluginInstanceRepo->prepareData($pluginData);
    }
682486
protected function prepareData($data)
    {
        $default = new \StdClass;
        $default->name = null;
        $default->gender = null;
        $default->probability = null;
        $default->count = null;

        return (object) array_merge(
            (array) $default,
            (array) $data
        );
    }
179534
private function prepareData($params = [], $options = [])
    {
        if(array_get($options, 'content_type') == "json") {
            $data['json'] = $params; // pass data as array which gets json_encoded
        } else {
            $data['query'] = $this->prepareQueryString($params); // pass data as query string
        }

        return array_merge($data, $options);
    }
60362
protected function finalData($passedData)
    {

        $overwrittenData = $this->overwrittenData;
        $this->overwrittenData = [];

        foreach ($overwrittenData as $key=>$value) {
            $passedData[$key] = $value;
        }

        return $passedData;

    }
337342
public function getCalculationFields(array $fieldData)
    {
        $output = array();

        // Perform automatic calculation
        if (isset($this->_fieldDefinition['gtf_calculate_using'])) {
            $sources = explode(self::FIELD_SEP, $this->_fieldDefinition['gtf_calculate_using']);

            foreach ($sources as $source) {
                if (isset($fieldData[$source]) && $fieldData[$source]) {
                    $output[$source] = $fieldData[$source];
                } else {
                    $output[$source] = null;
                }
            }
        }
        return array_reverse($output, true);
    }
1276646
private function prepareData(array $data)
    {
        $inserts = array_dot($data);
        $updates = [];
        $deletes = [];

        foreach ($this->model()->lists('key') as $key) {
            if (isset($inserts[$key]))
                $updates[$key] = $inserts[$key];
            else
                $deletes[]     = $key;

            unset($inserts[$key]);
        }

        return [$inserts, $updates, $deletes];
    }
493649
protected function prepPostData()
    {
        $oInput = Factory::service('Input');
        $aData  = [
            'first_name'               => trim(strip_tags($oInput->post('first_name'))),
            'last_name'                => trim(strip_tags($oInput->post('last_name'))),
            'organisation'             => trim(strip_tags($oInput->post('organisation'))),
            'email'                    => trim(strip_tags($oInput->post('email'))),
            'billing_email'            => trim(strip_tags($oInput->post('billing_email'))),
            'telephone'                => trim(strip_tags($oInput->post('telephone'))),
            'vat_number'               => trim(strip_tags($oInput->post('vat_number'))),
            'billing_address_line_1'   => trim(strip_tags($oInput->post('billing_address_line_1'))),
            'billing_address_line_2'   => trim(strip_tags($oInput->post('billing_address_line_2'))),
            'billing_address_town'     => trim(strip_tags($oInput->post('billing_address_town'))),
            'billing_address_county'   => trim(strip_tags($oInput->post('billing_address_county'))),
            'billing_address_postcode' => trim(strip_tags($oInput->post('billing_address_postcode'))),
            'billing_address_country'  => trim(strip_tags($oInput->post('billing_address_country'))),
        ];

        return $aData;
    }
180283
private function prepareResponseData($data)
    {
        switch (true)
        {
            case is_object($data):
                if (method_exists($data, 'toArray'))
                {
                    $data = $data->toArray();
                }
                else
                {
                    $data = get_object_vars($data);
                }
                $data = $this->prepareResponseData($data);
                break;
            case is_array($data):
                foreach ($data as $key => $value)
                {
                    $data[$key] = $this->prepareResponseData($value);
                }
                break;
        }
        return $data;
    }
273730
protected function prepareData(array $data)
	{
		$data = array_merge(array(
			'name'       => null,
			'email'      => null,
			'username'   => null,
			'id'         => null,
			'text'       => null,
			'ip'         => null,
			'user_agent' => null
		), $data);

		$data['original_text'] = $data['text'];

		if ($this->stringProcessor)
		{
			$data['text'] = $this->stringProcessor->prepare($data['text']);
		}

		return $data;
	}
417116
private static function prepareData(array $data)
    {
        $newData = [];

        foreach ($data as $paramName => $paramValue) {
            if (is_array($paramValue)) {
                foreach ($paramValue as $newKey => $newValue) {
                    $newData[trim($paramName).'['.trim($newKey).']'] = trim($newValue);
                }
            } else {
                $newData[trim($paramName)] = trim($paramValue);
            }
        }

        return $newData;
    }
894367
public function insert($insertData) {
		$this->provider('cache')->cacheClear('db', $this->getDao()->getTableName());
        $obj = $this->getConnection();
        $obj->insert($this->getDao()->getTableName(), $insertData);
        return $obj->count;
	}
325310
public function getMetadata($pluginName, $key)
    {
        return isset($this->requestMetadata[$pluginName][$key]) ? $this->requestMetadata[$pluginName][$key] : 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;
    }
956014
public static function get_plugin_list($plugintype) {
        self::init();

        if (!isset(self::$plugins[$plugintype])) {
            return array();
        }
        return self::$plugins[$plugintype];
    }
42544
private function getMappedSettings(array $settingsData): array
    {
        $settings = [];
        foreach ($settingsData as $settingName => $settingValue) {
            $settings[] = new ModuleSetting($settingName, $settingValue);
        }

        return $settings;
    }
43965
protected function getData(array $context)
    {
        $data = [];
        switch ($context['action']) {
            case 'UPDATE':
                $diff = $this->diff($context['old'], $context['new']);
                foreach ($diff as $item) {
                    list($k, $old, $new) = $item;
                    if (isset($context['new'][$k])) {
                        $data[$k] = [$old, $new];
                    }
                }
                break;
            case 'INSERT':
                foreach ($context['new'] as $k => $val) {
                    $data[$k] = [null, $val];
                }
                break;
            case 'DELETE':
                foreach ($context['old'] as $k => $val) {
                    $data[$k] = [$val, null];
                }
                break;
        }

        return $data;
    }
1331631
protected function prepareSiteData(
        array $siteData,
        string $createdByUserId,
        string $createdReason
    ) {
        $language = $this->buildLanguage($siteData);
        if (!empty($language)) {
            $siteData['language'] = $language;
        }

        $country = $this->buildCountry($siteData);
        if (!empty($country)) {
            $siteData['country'] = $country;
        }

        $domain = $this->buildDomain(
            $siteData,
            $createdByUserId,
            $createdReason
        );
        if (!empty($domain)) {
            $siteData['domain'] = $domain;
        }

        return $siteData;
    }