2013-03-04 2 views
0

안녕하세요, 제가 zend db select에 참여하고 싶습니다. 내가 setintegritycheck() 조인에 importants 알아. 나는SetIntegrityCheck를 Zend의 DB 어댑터에서

$select = $this->select(); 
$select->setintegritycheck(false); 
$select->from(array('info'),array()) 
      ->join(array('cfields'),'info.class=cfields.class_id',array('field_id','type_id')) 
      ->where('info.id=2'); 

같은 모델 객체가 오전하지만 내 경우에는 내가 모델에 아닙니다 때 그것을 구현하는 방법을 알고있다. 나는 dbadapter을 가지고있다. 지금이

$dbAdapter = MyManager::getDbAdapator('project'); 
    $select = $dbAdapter->select('info'); 

    $select->setIntegrityCheck(false); 
    $select->from(array('info'),array()) 
      ->join(array('cfields'),'info.class=cfields.class_id',array('field_id','type_id')) 
      ->where('info.id=2'); 

라인

$dbAdapter = MyManager::getDbAdapator('project'); 

처럼 내 쿼리를 프로젝트 데이터베이스의 어댑터를 반환 쓰고 있어요, 나는 그것을 cerfied했다. 지금 내 선택 객체가 DB 어댑터에서이 경우에 내가 setintegritycheck를 얻으려고 할 때 내가 어떤 몸 나는이 경우 integritycheck 넣을 수있는 방법을 말해 줄 수 오류를

Unrecognized method 'setIntegrityCheck()' 

를 생성합니다.

답변

1

setIntegrityCheck()Zend_Db_Table_Select에 대한 방법입니다. DB 어댑터에서 select를 빌드하는 경우 Zend_Db_Select을 대신 사용하므로 무결성 검사가 없으므로 비활성화 할 필요가 없습니다.

무결성 검사는 쿼리에서 반환 된 열이 테이블의 열과 일치하는지 확인하여 Zend_Db_Table 컨텍스트에서만 의미가 있습니다.