在我的项目中完成Messagebundle的安装后,我收到了提交查询的错误

时间:2014-11-11 06:14:44

标签: php symfony

我遇到了这种错误:

ContextErrorException:警告:/var/www/html/imsdemo/vendor/friendsofsymfony/message-bundle/FOS/MessageBundle/Entity/Thread.php第81行为foreach()提供的参数无效

请帮我解决这个错误...

protected function getParticipantsCollection()
{
    if ($this->participants == null) {
        $this->participants = new ArrayCollection();

/* Line 81*/ foreach ($this->metadata as $data) {
             $this->participants->add($data->getParticipant());
             }

    }

    return $this->participants;
}

这是给出错误的代码

1 个答案:

答案 0 :(得分:0)

我得到了问题为什么会发生,因为无论什么时候我做数据库的架构更新它采取MyBundle / Resources / config / doctrine YML文件不更新我的数据库,因为FosMessageBundle有...所以当我删除/ config / doctrine文件夹然后执行架构更新它工作正常...