setFields() 方法 public void setFields(array $data) $data array 字段名及其值组成的数组 源码: sdk/php/lib/XSDocument.class.php#L154 (显示) public function setFields($data){ if ($data === null) { $this->_data = array(); $this->_meta = $this->_terms...
...56 (显示) public function __construct($p = null, $d = null){ $this->_data = array(); if (is_array($p)) { $this->_data = $p; } elseif (is_string($p)) { if (strlen($p) !== self::$_resSize) { $this->setCharset($p); return; } $this->_meta = u...
...lass.php#L79 (显示) public function __get($name){ if (!isset($this->_data[$name])) { return null; } return $this->autoConvert($this->_data[$name]);} 魔术方法 __get 实现以对象属性方式获取文档字段值
...-8' : $this->_charset; return new ArrayIterator(XS::convert($this->_data, $to, $from)); } return new ArrayIterator($this->_data);} IteratorAggregate 接口, 以支持 foreach 遍历访问字段列表
...56 (显示) public function __construct($p = null, $d = null){ $this->_data = array(); if (is_array($p)) { $this->_data = $p; } elseif (is_string($p)) { if (strlen($p) !== self::$_resSize) { $this->setCharset($p); return; } $this->_meta = u...
...xx.class.php convert() 方法 public static mixed convert(mixed $data, string $to, string $from) $data mixed 需要转换的数据, 支持 string 和 array, 数组会自动递归转换 $to string 转换后的字符集 $from string 转换前的字符集 {return} ...
... unset($this->_meta[$name]); } else { unset($this->_data[$name]); } } else { if ($isMeta) { $this->_meta[$name] = $value; } else { $this->_data[$name] = $value; } }} 设置某个字段的值
...($conn, 'file://', 7)) { // write-only for saving index exchangable data to file // NOTE: this will cause file content be turncated $conn = substr($conn, 7); if (($sock = @fopen($conn, 'wb')) === false) { throw new XSException('Failed to open local file for wri...
...or zero size if ($len == 0) { return ''; } // loop to send data $this->check(); for ($buf = '', $size = $len;;) { $bytes = fread($this->_sock, $len); if ($bytes === false || strlen($bytes) == 0) { break; } $len -= strlen($bytes); $b...
... $size = strlen($buf)) == 0) { return true; } // loop to send data $this->check(); while (true) { $bytes = fwrite($this->_sock, $buf, $len); if ($bytes === false || $bytes === 0 || $bytes === $len) { break; } $len -= $bytes; $buf = sub...