this method is so the user can add the param list like this [ 'id' => 1, 'name' => 'bla' ]
the other strategies are built different because of the update statement

@param array $param

@return array
331326
public function prepareParam(array $param = null)
    {
        if (!$param) {
            return [];
        }
        $ret = [];

        foreach ($param as $key => $value) {
            if (is_array($value)) {
                $keyString = md5($key);
                foreach ($value as $subKey => $subValue) {
                    $ret[] =[':' . $keyString.$subKey , $subValue];
                }
            } else {
                $ret[] = [':' . md5($key), $value];
            }

        }

        return $ret;
    }
475531
protected function actionAdd($params=array())
    {
        $response = array(
            'errors' => array(),
            'data' => array(),
        );
        $values = $this->company->prepareParams($params);

        if (empty($values['name'])) {
            $response['errors'][] = 'cmp01';
        }
        if (empty($values['build'])) {
            $response['errors'][] = 'cmp02';
        }
        if (!$this->checkBuildExists($values['build'])) {
            $response['errors'][] = 'cmp03';
        }
        if ($this->checkCompanyExists($values['id'])) {
            $response['errors'][] = 'cmp04';
            $response['data']['id'] = $values['id'];
        }

        if (!empty($response['errors'])) {
            return $response;
        }
        $result = $this->company->add($values);
        if ($result) {
            $response['data']['id'] = $values['id'];
        } else {
            $response['errors'][] = 'err01';
        }
        return $response;
    }
817541
public static function castToArray($param)
    {
        if ($param instanceof \stdClass) {
            $param = (array) $param;

            return $param;
        }

        if ($param instanceof Arrayable) {
            return $param->toArray();
        }

        return $param;
    }
430667
protected function getQueryParam(string $param) : ?string
    {
        if ($this->queryParams === null) {
            $this->parseQueryParams();
        }
        return $this->queryParams[$param] ?? null;
    }
709010
public function get($param)
    {
        return array_key_exists($param, $this->data) ? $this->data[$param] : null;
    }
1353655
public function addQueryParams(array $params) {
		foreach ($params as $param => $value) {
			$this->setQueryParam($param, $value);
		}
		
		return $this;
	}
699807
public function init($param)
    {

        if (empty($param)) return false;

        $this->header = '';

        $param_list = new ParamList();
        foreach ($param as $key => $value) {
            if (property_exists($this, $key)) $this->$key = $value;
            elseif (property_exists($param_list, strtolower(str_replace('-', '_', $key)))) {
                if (is_string($value)) {
                    $this->header[] = new SingleParam($key, $value);
                } elseif (is_array($value)) {
                    $this->header[] = new MultiParam($key, $value);
                }
            }

        }


        return true;
    }
1114698
protected function _defaultInput($param)
    {
        $input = $param->formInputConfig();
        $name = $param->config('name');
        $input += [
            'type' => 'text',
            'required' => false,
            'label' => Inflector::humanize(preg_replace('/_id$/', '', $name)),
        ];
        if (!$param->visible()) {
            $input['type'] = 'hidden';
        }

        return $input;
    }
1325806
private function process_parameters($param){
    foreach ($param as $key => $val){
      //$val is an array
      if (\is_array($val)){
        $param[$key] = $this->process_parameters($val);
      }
      else {
        $param[$key] = $this->sanitize($val);
      }
    }
    //Return the processed parameters
    return $param;
  }
1129567
public function getParam(string $param)
    {
        if (! empty($this->match['params'][$param])) {
            return $this->match['params'][$param];
        }
    }
762891
public function list_commands($param = []){
    //Prepping, processing and validating the create user parameters
    $param = $this->process_parameters($param);
    //Setting the last action performed
    $this->last_action = "list-commands";

    //Defining  the $url_part and the command to be executed
    $url_part = "list-commands";
    if (isset($param['short'])){//short parameter is set
      $url_part .= "&short";
    }

    if (isset($param['nameonly'])){//nameonly parameter is set
      $url_part .= "&nameonly";
    }
    //Concatenating the closing single quote
    $url_part .="'";
    //Concatenating the header url and $url_part to create the full url to be executed
    $url_part = $this->get_header_url() . $url_part;

    //test
    $uid = $this->hostname;
    if ( !empty($param) ){
      $uid .= md5(json_encode($param));
    }

    if ( $this->cache_has($uid, 'list_commands') ){
      $result_call = $this->cache_get($uid, 'list_commands');
    }
    else {
      $result_call = $this->call_shell_exec($url_part);
      $this->cache_set($uid, 'list_commands', $result_call);
    }
    return $result_call;
  }
266642
public function bindParams($params)
    {
        $bindParams = [''];
        
        foreach ($params as $dbColumnName => $dbColumnValue) {
            $dbColumnValueAry = (!is_array($dbColumnValue)) ? [$dbColumnValue] : $dbColumnValue;
            
            $i = 1;
            foreach ($dbColumnValueAry as $dbColumnValueAryValue) {
                ${$dbColumnName . $i} = $dbColumnValueAryValue;
                
                if (is_numeric($dbColumnValueAryValue)) {
                    $bindParams[0] .= 'i';
                } else if (is_double($dbColumnValueAryValue)) {
                    $bindParams[0] .= 'd';
                } else if (is_string($dbColumnValueAryValue)) {
                    $bindParams[0] .= 's';
                } else if (is_null($dbColumnValueAryValue)) {
                    $bindParams[0] .= 's';
                } else {
                    $bindParams[0] .= 'b';
                }
                
                $bindParams[] = &${$dbColumnName . $i};
                $i++;
            }
        }
        
        call_user_func_array([$this->statement, 'bind_param'], $bindParams);
        
        return $this;
    }
552792
public function remove($param)
    {
        if ($param instanceof Model) {
            $param = $param->getId();
        }

        $item = $this->get($param);
        if ($item) {
            $id = (string) $item->getId();
            if ($this->_items[$id]) {
                unset($this->_items[$id]);
            }
        }

        return $this;

    }
1275882
public function getParam($param = null)
    {
        if (null === $param) {
            return $this->params;
        }

        return isset($this->params[$param]) ? $this->params[$param] : null;
    }
559496
public function orWhere($param){
        if (func_num_args() == 3) {

            $operator =strtolower(func_get_arg(1));
            if (is_numeric(array_search($operator, $this->condition))) {
                $this->whereby .=' or '.self::sanitize(func_get_arg(0))
                    .' '. $operator . ' \''
                    . self::sanitize(func_get_arg(2)) . '\'';
            } else {
                static::$response["status"] = "error";
                static::$response["response"] = "Invalid condition provided in where function";
                static::$response["code"] = 7000;
            }
        } else if (func_num_args() == 2) {
            $this->whereby .= ' or '.self::sanitize(func_get_arg(0)) . ' = \''
                . self::sanitize(func_get_arg(1)) . '\'';
        } else {
            static::$response["status"] = "error";
            static::$response["response"] = "Invalid parameters provided in where function";
            static::$response["code"] = 7001;
        }

        return $this;
    }
176310
public function addParams(array $params)
    {
        foreach ($params as $k => $v) {
            $this->addParam($k, $v);
        }
        return $this;
    }
1049517
protected function getParamOptions($checkParam)
    {
        if (isset($this->allowedParams[$checkParam])) {
            return array('param' => $checkParam, 'options' => $this->allowedParams[$checkParam]);
        } else {
            foreach ($this->allowedParams as $param => $options) {
                if (! empty($options['alias']) && in_array($checkParam, (array) $options['alias'])) {
                    return compact('param', 'options');
                }
            }
        }

        return false;
    }