我正在像这样使用 updateSingleValue:
$updated = $this->app['storage']->updateSingleValue('suggestions', $id, 'votes', $value);
$id
and$value
设置正确(即使我手动将它们设置为更正整数),并且肯定存在带有suggestions
字段votes
的内容类型。然而,这个函数返回false
,表明!$this->isValidColumn($field, $contenttype)
失败。
一个suggestion
json 格式的文件如下所示:
suggestion": {
"id": "25",
"values": {
"datechanged": "2015-01-03 13:25:02",
"id": "25",
"slug": "slug-o2sbdb",
"datecreated": "2015-01-03 13:25:02",
"datepublish": "2015-01-03 13:25:02",
"datedepublish": "1900-01-01 00:00:00",
"ownerid": "1",
"status": "published",
"title": "test title",
"description": "test description",
"votes": "0"
},
建议内容类型如下所示:
suggestions:
name: Suggestions
slug: suggestions
singular_name: Suggestion
singular_slug: suggestion
default_status: publish
fields:
title:
label: Title
type: text
class: large
required: true
pattern: ".{2,255}" # see: http://html5pattern.com/
error: "The Title field is required, and must contain at least 2 characters"
description:
label: Description
type: textarea
votes:
label: Votes
type: integer
我在这里做错了什么?