function set($key,$val) {
		if (array_key_exists($key,$this->fields)) {
			$val=is_null($val) && $this->fields[$key]['nullable']?
				NULL:$this->db->value($this->fields[$key]['pdo_type'],$val);
			if ($this->fields[$key]['initial']!==$val ||
				$this->fields[$key]['default']!==$val && is_null($val))
				$this->fields[$key]['changed']=TRUE;
			return $this->fields[$key]['value']=$val;
		}
		// Adjust result on existing expressions
		if (isset($this->adhoc[$key]))
			$this->adhoc[$key]['value']=$val;
		elseif (is_string($val))
			// Parenthesize expression in case it's a subquery
			$this->adhoc[$key]=['expr'=>'('.$val.')','value'=>NULL];
		else
			$this->props[$key]=$val;
		return $val;
	}
function set($key,$val) {
		if (array_key_exists($key,$this->fields)) {
			$val=is_null($val) && $this->fields[$key]['nullable']?
				NULL:$this->db->value($this->fields[$key]['pdo_type'],$val);
			if ($this->fields[$key]['initial']!==$val ||
				$this->fields[$key]['default']!==$val && is_null($val))
				$this->fields[$key]['changed']=TRUE;
			return $this->fields[$key]['value']=$val;
		}
		// Adjust result on existing expressions
		if (isset($this->adhoc[$key]))
			$this->adhoc[$key]['value']=$val;
		elseif (is_string($val))
			// Parenthesize expression in case it's a subquery
			$this->adhoc[$key]=['expr'=>'('.$val.')','value'=>NULL];
		else
			$this->props[$key]=$val;
		return $val;
	}
function set ( $ key , $ val ) { if ( array_key_exists ( $ key , $ this -> fields ) ) { $ val = is_null ( $ val ) && $ this -> fields [ $ key ] [ 'nullable' ] ? NULL : $ this -> db -> value ( $ this -> fields [ $ key ] [ 'pdo_type' ] , $ val ) ; if ( $ this -> fields [ $ key ] [ 'initial' ] !== $ val || $ this -> fields [ $ key ] [ 'default' ] !== $ val && is_null ( $ val ) ) $ this -> fields [ $ key ] [ 'changed' ] = TRUE ; return $ this -> fields [ $ key ] [ 'value' ] = $ val ; } // Adjust result on existing expressions if ( isset ( $ this -> adhoc [ $ key ] ) ) $ this -> adhoc [ $ key ] [ 'value' ] = $ val ; elseif ( is_string ( $ val ) ) // Parenthesize expression in case it's a subquery $ this -> adhoc [ $ key ] = [ 'expr' => '(' . $ val . ')' , 'value' => NULL ] ; else $ this -> props [ $ key ] = $ val ; return $ val ; }
Assign value to field
@return scalar
@param $key string
@param $val scalar
Assign value to field