我想通过href链接修改一列,我可以更改但此更改不会保存在可以帮助我的数据库中?在我的控制器中:
public function updateAlertesAction()
{
$date=$this->getRequest()->query->get('date');
$CI=$this->getRequest()->query->get('CI');
$cell=$this->getRequest()->query->get('cell');
$kpi_name=$this->getRequest()->query->get('cmts');
$KPI = $this->getDoctrine()
->getEntityManager()
->getRepository('AdminBlogBundle:StatAlert')
->findBy(array('cell' => '$idKPI', 'ci' => '$CI', 'dat' => '$date'));
$KPI->setCmts($kpi_name);
$em = $this->getDoctrine()->getEntityManager();
$em->persist($KPI);
$em->flush();
return new Response ($kpi_name.' Updaate Ok : '.$KPI->getCmts());
}
他显示此错误消息
致命错误:在第44行对D:\EasyPHP-5.3.3.1\www\alerteurs1\vendor\doctrine-dbal\lib\Doctrine\DBAL\Types\DateType.php中的非对象调用成员函数 format()
如果我替换搜索 ->find(array('cell' => 'TUN1196S1')); 我有警告:array_combine() [function.array-combine]:两个参数在 D:\EasyPHP-5.3.3.1\www\alerteurs1\vendor\doctrine\lib\Doctrine\ORM\EntityRepository 中应该有相同数量的元素。第 126 行