代码之家  ›  专栏  ›  技术社区  ›  chris

ZendFramework 1.12和Doctrine不能让查询工作。

  •  1
  • chris  · 技术社区  · 6 年前

    我对ZF1和Doctorine还不太熟悉,我想不出问题来。我继承了一个古老的保护,所以我正在学习,因为我去这个。

    这是我的模型

    public function recordResponded($contact_id = 0)
        {
            $this->createQuery()
                ->update()
                ->set($this->_tableAlias . 'responded', '1')
                ->where($this->_tableAlias . '.responded.contact_id', $contact_id)
                ->execute()
            ;
            return true;
        }
    

    这是我控制器里的东西

    public function responseAction() {
            header('Content-Type: application/json');
            $this->getHelper('layout')->disableLayout();
            $this->getHelper('viewRenderer')->setNoRender(true);
    
    
            $contact_id = $this->getRequest()->getPost('contact_id', null);
            if(empty($contact_id) || !preg_match("/^[0-9]+$/", $contact_id)) {
                echo json_decode(array('message' => 'Failed to record response, numeric id required'));
            }
    
    
    
            Model_ContactTable::getInstance()->recordResponded($contact_id);
    
            echo json_encode(['status' => 'success']);
    
        }
    

    不管是什么原因,我现在都不知道,因为我到处找,从我能收集到的信息来看,这是更新数据库中一行中单个条目的正确方法。

    还有人看到我丢失的东西吗?我只是不断地得到一个错误,但它是一个覆盖,没有堆栈跟踪或任何其他类型的错误,这将是可怕的,但我也不知道如何打开它。不管怎样,有什么事吗?

    0 回复  |  直到 6 年前