模型中foreach添加数据中自动验证问题

浏览:926 发布日期:2014/07/30 分类:求助交流 关键字: 自动验证,Model
看看下面的输出,怎么回事??select语句都对的,验证错误输出就是有问题

Ypage\Model\TagModel object
(
[tableName:protected] => tag
[_validate:protected] => Array
(
[0] => Array
(
[0] => name
[1] => 2,12
[2] => -1
[3] => 0
[4] => length
)

[1] => Array
(
[0] => name
[1] => checkDenyTag
[2] => -2
[3] => 0
[4] => callback
)

[2] => Array
(
[0] => name
[1] =>
[2] => -3
[3] => 0
[4] => unique
)

)

[_auto:protected] => Array
(
)

[db:protected] => Think\Db\Driver\Mysql object
(
[dbType:protected] =>
[autoFree:protected] =>
[model:protected] => _think_
[pconnect:protected] =>
[queryStr:protected] => SELECT * FROM `cx_tag` WHERE ( `name` = '小苹果' ) LIMIT 1
[modelSql:protected] => Array
(
[Tag] => SELECT * FROM `cx_tag` WHERE ( `name` = '小苹果' ) LIMIT 1
)

[lastInsID:protected] =>
[numRows:protected] => 1
[numCols:protected] => 0
[transTimes:protected] => 0
[error:protected] =>
[linkID:protected] => Array
(
[0] => Resource id #35
)

[_linkID:protected] => Resource id #35
[queryID:protected] => Resource id #37
[connected:protected] => 1
[comparison:protected] => Array
(
[eq] => =
[neq] => <>
[gt] => >
[egt] => >=
[lt] => <
[elt] => <=
[notlike] => NOT LIKE
[like] => LIKE
[in] => IN
[notin] => NOT IN
)

[selectSql:protected] => SELECT%DISTINCT% %FIELD% FROM %TABLE%%JOIN%%WHERE%%GROUP%%HAVING%%ORDER%%LIMIT% %UNION%%COMMENT%
[bind:protected] => Array
(
)

)

[pk:protected] => id
[autoinc:protected] => 1
[tablePrefix:protected] => cx_
[name:protected] => Tag
[dbName:protected] =>
[connection:protected] =>
[trueTableName:protected] => cx_tag
[error:protected] => -3
[fields:protected] => Array
(
[0] => id
[1] => name
[_pk] => id
[_type] => Array
(
[id] => int(10) unsigned
[name] => varchar(12)
)

)

[data:protected] => Array
(
[id] => 27
[name] => 小苹果
)

[options:protected] => Array
(
)

[_map:protected] => Array
(
)

[_scope:protected] => Array
(
)

[autoCheckFields:protected] => 1
[patchValidate:protected] =>
[methods:protected] => Array
(
[0] => order
[1] => alias
[2] => having
[3] => group
[4] => lock
[5] => distinct
[6] => auto
[7] => filter
[8] => validate
[9] => result
[10] => token
)

)
Ypage\Model\TagModel object
(
[tableName:protected] => tag
[_validate:protected] => Array
(
[0] => Array
(
[0] => name
[1] => 2,12
[2] => -1
[3] => 0
[4] => length
)

[1] => Array
(
[0] => name
[1] => checkDenyTag
[2] => -2
[3] => 0
[4] => callback
)

[2] => Array
(
[0] => name
[1] =>
[2] => -3
[3] => 0
[4] => unique
)

)

[_auto:protected] => Array
(
)

[db:protected] => Think\Db\Driver\Mysql object
(
[dbType:protected] =>
[autoFree:protected] =>
[model:protected] => _think_
[pconnect:protected] =>
[queryStr:protected] => SELECT * FROM `cx_tag` WHERE ( `name` = '怎么可以这样' ) LIMIT 1
[modelSql:protected] => Array
(
[Tag] => SELECT * FROM `cx_tag` WHERE ( `name` = '怎么可以这样' ) LIMIT 1
)

[lastInsID:protected] =>
[numRows:protected] => 0
[numCols:protected] => 0
[transTimes:protected] => 0
[error:protected] =>
[linkID:protected] => Array
(
[0] => Resource id #35
)

[_linkID:protected] => Resource id #35
[queryID:protected] => Resource id #39
[connected:protected] => 1
[comparison:protected] => Array
(
[eq] => =
[neq] => <>
[gt] => >
[egt] => >=
[lt] => <
[elt] => <=
[notlike] => NOT LIKE
[like] => LIKE
[in] => IN
[notin] => NOT IN
)

[selectSql:protected] => SELECT%DISTINCT% %FIELD% FROM %TABLE%%JOIN%%WHERE%%GROUP%%HAVING%%ORDER%%LIMIT% %UNION%%COMMENT%
[bind:protected] => Array
(
)

)

[pk:protected] => id
[autoinc:protected] => 1
[tablePrefix:protected] => cx_
[name:protected] => Tag
[dbName:protected] =>
[connection:protected] =>
[trueTableName:protected] => cx_tag
[error:protected] => -3
[fields:protected] => Array
(
[0] => id
[1] => name
[_pk] => id
[_type] => Array
(
[id] => int(10) unsigned
[name] => varchar(12)
)

)

[data:protected] => Array
(
[id] => 27
[name] => 小苹果
)

[options:protected] => Array
(
)

[_map:protected] => Array
(
)

[_scope:protected] => Array
(
)

[autoCheckFields:protected] => 1
[patchValidate:protected] =>
[methods:protected] => Array
(
[0] => order
[1] => alias
[2] => having
[3] => group
[4] => lock
[5] => distinct
[6] => auto
[7] => filter
[8] => validate
[9] => result
[10] => token
)

)
Ypage\Model\TagModel object
(
[tableName:protected] => tag
[_validate:protected] => Array
(
[0] => Array
(
[0] => name
[1] => 2,12
[2] => -1
[3] => 0
[4] => length
)

[1] => Array
(
[0] => name
[1] => checkDenyTag
[2] => -2
[3] => 0
[4] => callback
)

[2] => Array
(
[0] => name
[1] =>
[2] => -3
[3] => 0
[4] => unique
)

)

[_auto:protected] => Array
(
)

[db:protected] => Think\Db\Driver\Mysql object
(
[dbType:protected] =>
[autoFree:protected] =>
[model:protected] => _think_
[pconnect:protected] =>
[queryStr:protected] => SELECT * FROM `cx_tag` WHERE ( `name` = '我是谁啊' ) LIMIT 1
[modelSql:protected] => Array
(
[Tag] => SELECT * FROM `cx_tag` WHERE ( `name` = '我是谁啊' ) LIMIT 1
)

[lastInsID:protected] =>
[numRows:protected] => 0
[numCols:protected] => 0
[transTimes:protected] => 0
[error:protected] =>
[linkID:protected] => Array
(
[0] => Resource id #35
)

[_linkID:protected] => Resource id #35
[queryID:protected] => Resource id #41
[connected:protected] => 1
[comparison:protected] => Array
(
[eq] => =
[neq] => <>
[gt] => >
[egt] => >=
[lt] => <
[elt] => <=
[notlike] => NOT LIKE
[like] => LIKE
[in] => IN
[notin] => NOT IN
)

[selectSql:protected] => SELECT%DISTINCT% %FIELD% FROM %TABLE%%JOIN%%WHERE%%GROUP%%HAVING%%ORDER%%LIMIT% %UNION%%COMMENT%
[bind:protected] => Array
(
)

)

[pk:protected] => id
[autoinc:protected] => 1
[tablePrefix:protected] => cx_
[name:protected] => Tag
[dbName:protected] =>
[connection:protected] =>
[trueTableName:protected] => cx_tag
[error:protected] => -3
[fields:protected] => Array
(
[0] => id
[1] => name
[_pk] => id
[_type] => Array
(
[id] => int(10) unsigned
[name] => varchar(12)
)

)

[data:protected] => Array
(
[id] => 27
[name] => 小苹果
)

[options:protected] => Array
(
)

[_map:protected] => Array
(
)

[_scope:protected] => Array
(
)

[autoCheckFields:protected] => 1
[patchValidate:protected] =>
[methods:protected] => Array
(
[0] => order
[1] => alias
[2] => having
[3] => group
[4] => lock
[5] => distinct
[6] => auto
[7] => filter
[8] => validate
[9] => result
[10] => token
)

)
Ypage\Model\TagModel object
(
[tableName:protected] => tag
[_validate:protected] => Array
(
[0] => Array
(
[0] => name
[1] => 2,12
[2] => -1
[3] => 0
[4] => length
)

[1] => Array
(
[0] => name
[1] => checkDenyTag
[2] => -2
[3] => 0
[4] => callback
)

[2] => Array
(
[0] => name
[1] =>
[2] => -3
[3] => 0
[4] => unique
)

)

[_auto:protected] => Array
(
)

[db:protected] => Think\Db\Driver\Mysql object
(
[dbType:protected] =>
[autoFree:protected] =>
[model:protected] => _think_
[pconnect:protected] =>
[queryStr:protected] => SELECT `id`,`name` FROM `cx_tag` WHERE ( `name` = '我是谁啊' )
[modelSql:protected] => Array
(
[Tag] => SELECT `id`,`name` FROM `cx_tag` WHERE ( `name` = '我是谁啊' )
)

[lastInsID:protected] =>
[numRows:protected] => 0
[numCols:protected] => 0
[transTimes:protected] => 0
[error:protected] =>
[linkID:protected] => Array
(
[0] => Resource id #35
)

[_linkID:protected] => Resource id #35
[queryID:protected] => Resource id #42
[connected:protected] => 1
[comparison:protected] => Array
(
[eq] => =
[neq] => <>
[gt] => >
[egt] => >=
[lt] => <
[elt] => <=
[notlike] => NOT LIKE
[like] => LIKE
[in] => IN
[notin] => NOT IN
)

[selectSql:protected] => SELECT%DISTINCT% %FIELD% FROM %TABLE%%JOIN%%WHERE%%GROUP%%HAVING%%ORDER%%LIMIT% %UNION%%COMMENT%
[bind:protected] => Array
(
)

)

[pk:protected] => id
[autoinc:protected] => 1
[tablePrefix:protected] => cx_
[name:protected] => Tag
[dbName:protected] =>
[connection:protected] =>
[trueTableName:protected] => cx_tag
[error:protected] => -1
[fields:protected] => Array
(
[0] => id
[1] => name
[_pk] => id
[_type] => Array
(
[id] => int(10) unsigned
[name] => varchar(12)
)

)

[data:protected] => Array
(
[id] => 27
[name] => 小苹果
)

[options:protected] => Array
(
)

[_map:protected] => Array
(
)

[_scope:protected] => Array
(
)

[autoCheckFields:protected] => 1
[patchValidate:protected] =>
[methods:protected] => Array
(
[0] => order
[1] => alias
[2] => having
[3] => group
[4] => lock
[5] => distinct
[6] => auto
[7] => filter
[8] => validate
[9] => result
[10] => token
)

)
27
最佳答案
评论( 相关
后面还有条评论,点击查看>>