Call stored procedure
@param string $function
@param array $params
@return boolean
480971
public function call($function, $params) {

		if(null === $this -> getAdapter()) {
			return trigger_error(sprintf('No database adapter was set in "%s"', __METHOD__), E_USER_ERROR);
		}

		if(null !== $function && false === is_string($function)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($function)), E_USER_ERROR);
		}

		if(false === is_array($params)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($params)), E_USER_ERROR);
		}

		$query  = sprintf('CALL %s(%s)', $function, implode(array_fill(0, count($params), '?'), ','));
		$output = $this -> getAdapter() -> query($query, $params) -> execute();

		return $output;
	}
1120140
protected function query($query, ...$params)
    {
        $saveParams = array_map([$this, 'quote'], $params);

        $baseSql = str_replace('{table}', $this->table, $query);
        $sql = vsprintf($baseSql, $saveParams);

        $ret = $this->server->query($sql);

        if ($ret === false) {
            trigger_error($this->server->error . " $sql", E_USER_NOTICE);
        }

        return $ret;
    }
686562
public static function run($query, $params=array()) {
		
		$self = static::getInstance();
		
		$self->openConnection();
		
		$ret = NULL;
		
		try {
			
			// prepare query
			$stat = $self->handler->prepare($query);

			// bind parameters
			$stat->execute((array)$params);

			// count affected rows
			$affected = $stat->rowCount();
			
		} catch (\PDOException $e) {
			
			// logger
			$self->logParamQuery($query, 0, $params);
			
			switch ($e->getCode()) {
				
				// integrity constraint violation
				/*
				 case '23000':
					 $message = 'Database integrity constraint violation';
					 break;
				 */
				default:
					$message = $e->getMessage();
					break;
			}
			
			$self->addError($message);
			
			$affected = 0;
			
		} catch (\Exception $e) {
			
			// logger
			$self->logParamQuery($query, 0, $params);
			$self->addError($e->getMessage());
			$affected = 0;
			
		}
		
		$stat->closeCursor();
		$self->logParamQuery($query, $affected, $params);
		
		return $affected;
			
	}
1195154
public function execute(array $params = [])
    {
        $this->formatSqlByParams($params);
        $result = $this->connection->query($this->sql);
        if ($result === false) {
            throw new MysqlException('Mysql execute error，connectError=' . $this->connection->connect_error . ' error=' . $this->connection->error);
        }

        $this->pushSqlToStack($this->sql);

        return $result;
    }
79585
public function exec($query, $params=array()) {

		$this->openConnection();
		
		$this->query = $query;
		
		try {

			$stat = $this->handler->prepare($this->query);
			$stat->execute((array)$params);
			$affected = $stat->rowCount();

		} catch (\PDOException $e) {

			// logger
			$this->logParamQuery($this->query, 0, $params);

			switch ($e->getCode()) {
				
				// integrity constraint violation
				/*
				case '23000':
					$message = 'Database integrity constraint violation';
					break;
				*/
				default:
					$message = $e->getMessage();
					break;
			}
			
			$this->addError($message);
				
			$affected = 0;
		
		} catch (\Exception $e) {
			
			// logger
			$this->logParamQuery($this->query, 0, $params);
			$this->addError($e->getMessage());
			$affected = 0;
		
		}
		
		$stat->closeCursor();
		$this->logParamQuery($this->query, $affected, $params);
		
		return $affected;
		
	}
358863
function buildFunctionParams( &$params )
    {
        foreach( array_keys( $params ) as $paramKey )
        {
            if( $this->isFunctionParam( $params[$paramKey] ) )
            {
                $params[$paramKey] = $this->execFunction( $params[$paramKey] );
            }
            else if( is_array( $params[$paramKey] ) )
            {
                $this->buildFunctionParams( $params[$paramKey] );
            }
        }
    }
1171730
public function run($sql, array $params = array())
    {
        $sth = $this->pdo->prepare($sql);

        foreach ($params as $key => $value) {
            $key = is_numeric($key) ? $key + 1 : ":$key";
            $sth->bindValue($key, $value);
        }

        $sth->execute($params);
        $this->executed[] = $sql;
        return $sth;
    }
970151
public function call($method, Array $params = [])
    {
        $rawResult = parent::call($method, $params);

        switch ($method) {
            case 'GetCarBrandAndModel':
                $result = $rawResult->GetCarBrandAndModelReturn->MakeModelBean;
            break;

            case 'GetCarBrand':
                $result = $rawResult->GetCarBrandReturn->x_car_brand->string;
        }

        return $result;
    }
51167
public function call($params)
    {
        //Prevent user forgetting connect with the ERP.
        $this->autoConnect();

        $args = array_merge(
            [$this->db, $this->uid, $this->password],
            func_get_args()
        );

        return collect(call_user_func_array([$this->object,'execute_kw'], $args));
    }
443604
public function SoapCall($function,
    array $params,
    array $options = null,
    $inputHeader = null,
    &$outputHeaders = null
  ) {
    return $this->__soapCall($function, $params, $options, $inputHeader, $outputHeaders);
  }
538743
public function invokeFunction($function, $vars = [])
    {
        $reflect = new \ReflectionFunction($function);
        $args = $this->bindParams($reflect, $vars);
        return $reflect->invokeArgs($args);
    }
1151066
public function execute($params = [])
    {
        return $this->getDb()
            ->createCommand()
            ->setText($this->buildSql())
            ->execute(array_merge($this->getParams(), $params));
    }
1277769
public function execute($query = null, array $params = []) : object
    {
        // When using one argument and its array, assume its $params
        if (is_array($query)) {
            $params = $query;
            $query = null;
        }

        if (!$query) {
            $query = $this->getSQL();
        }

        return parent::execute($query, $params);
    }
604500
public static function run(string $function, array $args = [])
  {
    if (!class_exists(\App\Utils\Shortcuts::class)) {
      throw new ShortcutsClassNotFoundException;
    }

    $shortcuts = new \App\Utils\Shortcuts;

    if (method_exists($shortcuts, $function)) {
      return call_user_func_array([$shortcuts, $function], $args);
    }

    throw new UndefinedShortcutException("Shortcut '{$function}()' does not exist", $args);
  }
333701
public function bindValues (&$query, $params)
	{
		
		foreach ($params as $key => $value)
		{
			
			if (is_array ($value))
			{
				if (!$query->bindValue ($key, $value[0], $value[1]))
				{
					return FALSE;
				}
			}
			else
			{
				if (!$query->bindValue ($key, $value))
				{
					return FALSE;
				}
			}
			
		}
		
		return TRUE;
		
	}
6170
public static ResultSet callQuery(Connection conn, String sql, Object... params) throws SQLException {
		CallableStatement proc = null;
		try {
			proc = StatementUtil.prepareCall(conn, sql, params);
			return proc.executeQuery();
		} finally {
			DbUtil.close(proc);
		}
	}
110412
public function insert($params)
    {
        if (is_array($params)) {
            $count_rows = count($params['columns']);
            $increment = 1;
            foreach ($params['columns'] as $keys => $value) {
                for ($i = 1; $i <= $count_rows; $i++) {
                    $data[$keys] = $value;
                }
            }
            foreach ($data as $keys => $values) {
                if ($increment == $count_rows) {
                    $columns[] = "{$keys} = '{$values}'";
                } else {
                    $columns[] = "{$keys} = '{$values}'";
                }
                $increment++;
            }
            $columns = implode(' , ', $columns);
            $query = "INSERT INTO `{$params['table']}`SET {$columns}";
            if (isset($params['debug']) and strtolower($params['debug']) === 'on') {
                var_dump($query);
            }

            return $query;
        } else {
            return false;
        }
    }