phprs\BindParams::set PHP Method

set() public method

设置绑定
public set ( integer $id, $params, $method_info )
$id integer 参数声明的序号
$params 绑定相关参数:[目标变量 , 源变量]
$method_info 方法变量信息 [ [变量名, 是否引用, 是否有默认值, 默认值], ...
    public function set($id, $params, $method_info)
    {
        Verify::isTrue(is_array($params) && count($params) == 2, "{$this->class_name}::{$this->method_name} invalid @param");
        list($to, $from) = $params;
        $pos = -1;
        $step = 0;
        foreach ($method_info as $item) {
            list($param_name, ) = $item;
            if ($to === $param_name) {
                $pos = $step;
                break;
            }
            $step++;
        }
        Verify::isTrue($pos !== -1, "{$this->class_name}::{$this->method_name} param: {$to} not found");
        Verify::isTrue(!isset($this->params[$pos]), "{$this->class_name}::{$this->method_name} param: {$to} repeated bound");
        $this->params[$pos] = array(substr($from, 0, 1) != '$', $from, $item, $id);
        //[是否常量,  值 , 参数信息]
    }