开发者

CakePHP calling field() within the model

I am writing a function within the php of the model. Is there any issue with using

$this->field('something)

while inside the model? I can use other things lik开发者_JS百科e $this->saveField(...) fine but for some reason this is not returning me the value in the table correctly. Just wanted to make sure, thanks!


You have to specify the conditions first, like so:

$this->field('field_name', $conditions);

Or, I think you can also try setting the id first

$this->id = $id;
$this->field('field_name');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜