@param array $params

@return array
552444
public function getCampaignBudgetsData($params = [])
    {
        $results    =[];
        $today      = $params['dateFrom']->format('Y-m-d 00:00:00');
        $monthStart = $params['dateFrom']->format('Y-m-01 00:00:00');
        $monthEnd   = $params['dateFrom']->format('Y-m-t 23:59:59');

        // get financials from ledger based on returned Lead list
        $q = $this->_em->getConnection()->createQueryBuilder();
        $q->select("css.contactsource_id, SUM(css.type = 'limited') as daily")
        ->from(MAUTIC_TABLE_PREFIX.'contactsource_stats', 'css');

        // join Contact Source table to get source name
        $q->join('css', MAUTIC_TABLE_PREFIX.'contactsource', 'cs', 'css.contactsource_id = cs.id');

        $q->where(
            $q->expr()->andX(
                $q->expr()->gte('css.date_added', ':today'),
                $q->expr()->eq('css.campaign_id', ':campaign_id')
            )
        );

        $q->setParameter('today', $today);
        $q->setParameter('campaign_id', $params['campaignId']);

        $q->groupBy('css.contactsource_id');

        $q->orderBy('(cs.name)', 'ASC');

        $todayCount = $q->execute()->fetchAll();

        $q->resetQueryParts(['select', 'where'])
            ->select("css.contactsource_id, cs.name as source, SUM(css.type = 'limited') as mtd")
            ->where(
                $q->expr()->andX(
                    $q->expr()->gte('css.date_added', ':start'),
                    $q->expr()->lte('css.date_added', ':end'),
                    $q->expr()->eq('css.campaign_id', ':campaign_id')
                )
            );
        $q->setParameter('start', $monthStart);
        $q->setParameter('end', $monthEnd);
        $q->setParameter('campaign_id', $params['campaignId']);
        $mtdCount = $q->execute()->fetchAll();
        if (!empty($mtdCount)) {
            $daily = $this->idToKey($todayCount);
            $mtd   = $this->idToKey($mtdCount);

            foreach ($mtd as $row) {
                $dataRow           = [];
                $dataRow[]         = $row['source'];
                $dataRow[]         = '[Cap Name]';
                $dataRow[]         = isset($daily[$row['contactsource_id']]['daily']) ? $daily[$row['contactsource_id']]['daily'] : 0;
                $dataRow[]         = '0';
                $dataRow[]         = '0';
                $dataRow[]         = $row['mtd'];
                $dataRow[]         = '0';
                $dataRow[]         = '0';
                $results['rows'][] = $dataRow;
            }
        }

        return $results;
    }
1293946
private function splitParams(array $params)
    {
        $parameters = [];
        $files      = [];

        foreach ($params as $name => $value) {
            if (is_readable($value)) { //file
                $files[$name] = $value;
            } else {
                $parameters[$name] = $value;
            }
        }

        return [$parameters, $files];
    }
419831
public function get(array $params = [])
    {
        $entries = [];
        $this->getLogger()->info('Getting list of dataSets ');
        $response = $this->doGet($this->url, $params);

        foreach ($response as $item) {
            $entries[] = clone $this->hydrate($item);
        }

        return $entries;
    }
415748
protected function convertParamsToQuery(array $params)
    {
        $query = array();

        foreach ($params as $key => $val) {
            if (is_array($val)) {
                $val = implode(',', $val);
            } elseif ($val instanceof \DateTime) {
                $val = $val->format('Y-m-d');
            } elseif (is_bool($val)) {
                if ($val) {
                    $val = 1;
                } else {
                    continue;
                }
            } else {
                $val = urlencode($val);
            }
            $query[] = $key . '=' . $val;
        }

        return implode('&', $query);
    }
61007
protected function generateUrlArray(array $params)
    {
        $urlRequest = $this->getUrl() . '?' . http_build_query($params, null, '&');
        $urlArray = parse_url($urlRequest);

        return $urlArray;
    }
1323069
public function all(array $params = array())
    {
        $endpoint = '/admin/locations.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createCollection(Location::class, $response['locations']);
    }
843224
protected function prepareParams($params)
    {
        $data = [];
        foreach ($params as $key => $value) {
            if (is_object($value) && Str::is('Illuminate\*\Events\*', get_class($value))) {
                $value = $this->prepareParams(get_object_vars($value));
            }
            $data[$key] = htmlentities($this->exporter->exportValue($value), ENT_QUOTES, 'UTF-8', false);
        }

        return $data;
    }
1057129
public function resolveParams($params)
    {
        $resolved = array();

        foreach ($params as $param) {
            if ($param instanceof DescriptorInterface) {
                $resolved[] = $this->get($param->getName());

                continue;
            }

            $resolved[] = $param;
        }

        return $resolved;
    }
75006
public function index($params = [])
    {
        // Set the filters
        $params = (!empty($params))? $params : $this->app->request->input();

        // Get records
        $this->model->params = $params;
        $result = $this->model->search($params)->get();

        // Get pagination and number of records
        $pagination = array_merge(
            ['records' => $this->model->search($params)->count()],
            $this->model->pagination()
        );

        // Return results
        return [
            'success' => true,
            'paging' => $pagination,
            'data' => $result
        ];
    }
782128
public function getAll($params = [])
    {
        $result = $this->connection()->get($this->getEndpoint(), $params, true);

        return $this->collectionFromResult($result);
    }
798571
public function setParams(array $params = array())
    {
        foreach ($params as $key => $value) {
            if (null != $value) {
                $this->$key = $value;
            }
        }

        return $this;
    }
1260808
public function bind(array $params)
    {
        foreach ($params as $key => $value) {
            $this->addParam($value, $key);
        }
        return $this;
    }
550687
public static function decodeParams($params)
    {
        if(!$params) {
            return [];
        }
        $paramsArrayList = json_decode(json_encode($params), true);
        $decodedParams = [];
        foreach($paramsArrayList as $paramKey=>$paramValue){
            if(is_array($paramValue)) {
                foreach($paramValue as $languageSlug=>$langParamValue){
                    if($languageSlug == App::getLocale()) {
                        $decodedParams[$paramKey] = $langParamValue;
                        break;
                    }else{
                        $decodedParams[$paramKey] = "";
                    }
                }
            }else{
                $decodedParams[$paramKey] = $paramValue;
            }
        }
        return $decodedParams;
    }
305396
protected function prepareParams(array $params)
	{
		$prepared = [];
		
		foreach($params as $k => $v)
		{
			if(is_array($v))
			{
				foreach(array_values($v) as $i => $val)
				{
					$prepared[sprintf('%s%u', $k, $i)] = $val;
				}
			}
			else
			{
				$prepared[(string)$k] = $v;
			}
		}
		
		return $prepared;
	}
230253
protected function parseGroups($params)
    {
        if ($params == null) {
            return array();
        }

        if (is_array($params)) {
            return $params;
        }

        if (is_string($params)) {
            $list = explode(",", $params);
            foreach ($list as &$item) {
                $item = trim($item);
            }
            return $list;
        }
        return array();
    }
1054435
public function getAllParams(array $params)
    {
        $all = $this->defaults;

        if (isset($params['p'])) {
            foreach (explode(',', $params['p']) as $preset) {
                if (isset($this->presets[$preset])) {
                    $all = array_merge($all, $this->presets[$preset]);
                }
            }
        }

        return array_merge($all, $params);
    }
627558
public function setParams(array $params)
    {
        foreach ($this->params as $param) {
            if (!array_key_exists($param, $params)) {
                $methodName = 'unset'.ucfirst($param);

                if (method_exists($this, $methodName)) {
                    call_user_func(
                        [$this, $methodName]
                    );
                    continue;
                }
            }

            if (property_exists($this, $param)) {
                $methodName = 'set'.ucfirst($param);

                if (method_exists($this, $methodName)) {
                    call_user_func(
                        [$this, $methodName],
                        $params[$param]
                    );
                }
            }
        }

        return $this;
    }