Set up the boiler plate for the param array for any
static data call.

@param string $name of api call
@param mixed $requestId
@param mixed $data
@param string $listData
@param string $itemData
@return array
423648
protected function setUpParams($name = '', $requestId = null, $data = null, $listData = '', $itemData = '')
	{
		$params = [];
		if ( ! is_null($this->locale))
		{
			$params['locale'] = $this->locale;
		}
		if ( ! is_null($this->DDversion))
		{
			$params['version'] = $this->DDversion;
		}
		if ( ! $this->appendId($requestId) && $this->dataById($name))
		{
			$params['dataById'] = 'true';
		}
		if ( ! is_null($data))
		{
			if ($this->appendId($requestId))
			{
				if (is_array($data) && ! empty($data))
				{
					$data = implode(",", $data);
				}

				$params[$itemData] = $data;
			}
			else
			{
				if (is_array($data) && ! empty($data))
				{
					$data = implode(",", $data);
				}

				$params[$listData] = $data;
			}
		}

		return $params;
	}
534279
public function getInvoices(Get\RequestData $requestData)
    {
        $request = new Get\Request($requestData);

        $apiResponse = $this->sendRequest($request, Get\ApiResponse::class);
        /** @var Get\Response $response */
        $response = $apiResponse->getResponse();
        foreach ($response->getInvoices() as $invoice) {
            $invoiceDate = $invoice->getInvoiceDate();
            if ($invoiceDate !== null) {
                $invoiceDate->setTime(0, 0, 0);
            }

            // We need to convert the due date to DateTime because of inconsistencies in the Monsum API response.
            $dueDate = $invoice->getDueDate();
            if ($dueDate !== null) {
                $dueDate = new \DateTime($dueDate);
                $dueDate->setTime(0, 0, 0);
                $invoice->setDueDate($dueDate);
            }
        }

        return $apiResponse;
    }
329005
public function deleteTrashItem(
        TrashItemDeleteData $data = null,
        ?string $name = null
    ): FormInterface {
        $name = $name ?: StringUtil::fqcnToBlockPrefix(TrashItemDeleteType::class);

        return $this->formFactory->createNamed($name, TrashItemDeleteType::class, $data);
    }
680012
public function getUri(string $name, array $data = [], $warnData = true) : Uri
    {
        if (!isset($this->routes[$name])) {
            throw new \InvalidArgumentException(sprintf("Invalid route name '%s'", $name));
        }

        $route = $this->routes[$name];

        $uri = self::request()->getUri();
        $uri->removeAllQueries()
            ->setFragment(null)
            ->setPath($this->routeRegexp($route, $data))
        ;

        // $cloneData = $data;

        // append querystring
        if ($route->getUserInputs()) {
            $queryToAdd = [];
            foreach ($route->getUserInputs() as $querystring) {
                if (!isset($data[$querystring->getName()]) &&
                    $querystring->isMandatory() &&
                    $warnData &&
                    $route->getHttpMethod() != 'POST' &&
                    $route->getHttpMethod() != 'PUT' &&
                    $route->getHttpMethod() != 'DELETE'
                ) {
                    throw new \InvalidArgumentException(sprintf(
                        "Missing querystring '%s' to generate route '%s'",
                        $querystring->getName(),
                        $route->getName()
                    ));
                }

                if (isset($data[$querystring->getName()])) {
                    // unset($cloneData[$querystring->getName()]);
                    $queryToAdd[$querystring->getName()] = $data[$querystring->getName()];
                }
            }

            $uri->addQueries($queryToAdd);
        }

        /*
        // Args can be consumed by routeRegexp and not remove from cloneData
        if (sizeof($cloneData)) {
            throw new \InvalidArgumentException(sprintf(
                "Too many data to generate route '%s' with keys %s",
                $route->getName(),
                "'" . implode("', '", array_keys($cloneData)) . "'"
            ));
        }
        */

        return $uri;
    }
1298344
public function deserializeQuestion(array $itemData, AbstractItem $item = null, array $options = [])
    {
        return $this->getItemSerializer()->deserialize($itemData, $item, $options);
    }
245624
function(requestId, itemNames) {
		return protocol.implodeMessage(requestId,
			metadataMethods.GET_ITEMS,
			protocol.implodeDataArray(itemNames));
	}
94997
public function formatRequestData(array $data, $instanceId = null, bool $handleDelayedData = false): array
    {
        $delayedData = collect([]);

        $formattedData = collect($data)->filter(function ($value, $key) {
            // Filter only configured fields
            return in_array($key, $this->getDataKeys());

        })->map(function($value, $key) use($handleDelayedData, $delayedData, $instanceId) {
            if(!$field = $this->findFieldByKey($key)) {
                return $value;
            }

            try {
                // Apply formatter based on field configuration
                return $field->formatter()
                    ->setInstanceId($instanceId)
                    ->fromFront($field, $key, $value);

            } catch(SharpFormFieldFormattingMustBeDelayedException $exception) {
                // The formatter needs to be executed in a second pass. We delay it.
                if($handleDelayedData) {
                    $delayedData[$key] = $value;
                    return null;
                }

                throw $exception;
            }

        });

        if($handleDelayedData) {
            return [
                $formattedData->filter(function ($value, $key) use ($delayedData) {
                    return !$delayedData->has($key);
                })->all(),
                $delayedData->all()
            ];
        }

        return $formattedData->all();
    }
1048573
public function renderIfPjax($name = null, $data = null, $layout_callback = null) {
        if (is_array($name)) {
            list($data, $layout_callback, $name) = [$name, $data, null];
        }
        if (empty($data)) {
            $data = [];
        }
        if (!app('request')->isPjax() && is_callable($layout_callback)) {
            $data = array_merge($data, call_user_func($layout_callback));
        }
        return $this->show($name, $data);
    }
304881
protected function loadData(string $name)
	{
		if (isset($this->data[$name])) return $this->data[$name];
		else return null;
	}
855734
public function update ($item_id, array $data) {
		return $this->api->update($this->list_name, $item_id, $data);
	}
967660
public static function createFromArray($name, array $data = [])
    {
        $type = parent::createFromArray($name, $data);
        \assert($type instanceof self);
        $pos = \strpos($type->getType(), '[]');
        if ($pos !== false) {
            $type->setItems(\substr($type->getType(), 0, $pos));
        }
        $type->setType('array');

        foreach ($data as $key => $value) {
            switch ($key) {
                case 'uniqueItems':
                    $type->setUniqueItems($value);

                    break;
                case 'items':
                    if (\is_array($value) && isset($value['type'])) {
                        $type->setItems($value['type']);

                        break;
                    }
                    $type->setItems($value);

                    break;
                case 'minItems':
                    $type->setMinItems($value);

                    break;
                case 'maxItems':
                    $type->setMaxItems($value);

                    break;
            }
        }

        return $type;
    }
302545
public function item($modelName, $itemId = 0)
    {
        $bladeName = 'admin.model.pages.form';
        \View::composer($bladeName, ModelViewComposer::class);
        parent::item($modelName, $itemId);

        return $this->view = view($bladeName, $this->view->getData());
    }
959861
public function createSection(
        ?SectionCreateData $data = null,
        ?string $name = null
    ): FormInterface {
        $name = $name ?: StringUtil::fqcnToBlockPrefix(SectionCreateType::class);

        return $this->formFactory->createNamed(
            $name,
            SectionCreateType::class,
            $data ?? new SectionCreateData()
        );
    }
67007
public function updateSection(
        SectionUpdateData $data = null,
        ?string $name = null
    ): FormInterface {
        $name = $name ?: sprintf('update-section-%d', $data->getSection()->id);

        return $this->formFactory->createNamed($name, SectionUpdateType::class, $data);
    }
1334774
protected function getListData(string $module, string $listName) : array
    {
        $mc = new ModuleConfig(ConfigType::LISTS(), $module, $listName);
        try {
            $config = $mc->parseToArray();
            $listData = array_key_exists('items', $config) ? $config['items'] : [];
        } catch (InvalidArgumentException $e) {
            return [];
        }

        if (empty($listData)) {
            return [];
        }

        $result = [];
        foreach ($listData as $key => $data) {
            if ($data['inactive'] == '1') {
                continue;
            }
            $result[] = $key;
        }

        return $result;
    }
650561
public function contentEdit(
        ?ContentEditData $data = null,
        ?string $name = null,
        array $options = []
    ): FormInterface {
        $name = $name ?: StringUtil::fqcnToBlockPrefix(ContentEditType::class);
        $data = $data ?? new ContentEditData();

        if (empty($options['language_codes']) && null !== $data->getVersionInfo()) {
            $options['language_codes'] = $data->getVersionInfo()->languageCodes;
        }

        return $this->formFactory->createNamed(
            $name,
            ContentEditType::class,
            $data,
            $options
        );
    }
523476
private function createList($listId, $listParameters)
    {
        $providerServiceKey = $listParameters['subscriber_provider'];
        $provider = $this->providerFactory->create($providerServiceKey);
        $subscriberList = new SubscriberList($listId, $provider, $listParameters['merge_fields']);
        $subscriberList->setWebhookUrl($listParameters['webhook_url']);
        $subscriberList->setWebhookSecret($listParameters['webhook_secret']);

        return $subscriberList;
    }