0
我不能讓box()
方法工作,我只從它得到NULL
。RedBean從bean拆箱模型時返回null?
例如,如果我這樣做
$bean = \R::load('comment', 2);
print("\n\nBEAN:\n");
var_dump($bean);
$model = $bean->box();
print("\n\nMODEL:\n");
var_dump($model);
我得到這個
BEAN:
class RedBeanPHP\OODBBean#68 (10) {
protected $properties =>
array(4) {
'id' =>
string(1) "2"
'user' =>
string(1) "2"
'reply_to' =>
NULL
'message' =>
string(30) "Test comment 1"
}
protected $__info =>
array(4) {
'type' =>
string(7) "comment"
'sys.id' =>
string(2) "id"
'sys.orig' =>
array(5) {
'id' =>
string(1) "2"
'user' =>
string(1) "1"
'reply_to' =>
NULL
'message' =>
string(30) "Test comment 1"
}
'tainted' =>
bool(false)
'changed' =>
bool(false)
}
protected $beanHelper =>
class RedBeanPHP\BeanHelper\SimpleFacadeBeanHelper#17 (0) {
}
protected $fetchType =>
NULL
protected $withSql =>
string(0) ""
protected $withParams =>
array(0) {
}
protected $aliasName =>
NULL
protected $via =>
NULL
protected $noLoad =>
bool(false)
protected $all =>
bool(false)
}
MODEL:
NULL
很明顯,在bean的數據,所以爲什麼box()
返回NULL
?