LeagueWrap\Api\Staticdata::setUpParams PHP Method

setUpParams() protected method

Set up the boiler plate for the param array for any static data call.
protected setUpParams ( string $name = '', mixed $requestId = null, mixed $data = null, string $listData = '', string $itemData = '' ) : array
$name string of api call
$requestId mixed
$data mixed
$listData string
$itemData string
return array
    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;
    }