2011-12-25 1 views
0

메리 크리스마스!두 검색어를 추가하십시오.

나는

$q1 = Doctrine_Query::create() 
      ->from('order o') 
      ->innerJoin('o.shop s ') 
      ->innerJoin('o.customer c') 
      ->where('o.id = ?', $this->orderid_hashed) 
        ->fetchOne(); 
    $testid = 19; 
    $q2 = Doctrine_Query::create() 
      ->from('shopemployee se') 
      ->where('se.id = ?', $testid); 

    $this->q_all = $q1+$q2; 

그래서이 작동하고, 내 생각 심포니 1.4에서이 교리 쿼리를 추가하려면 다음 질문을해야합니까. 그러나 어떻게이 테이블 중 하나에 뭔가를 저장합니까? 예 :

$this->q_all -> setOrder()-> setId('123'); 
or 
$this->q_all -> setShopemployee()-> setId('123'); 

위의 코드는 작동하지 않습니다. 어떻게해야합니까? 미리 감사드립니다 !!!

크라우 너

+1

질문 이해에 어려움이 있습니다. 배열에 새 객체를 추가 하시겠습니까, 아니면 기존 객체를 수정 하시겠습니까? – MrGlass

답변

2

왜 doctrine에서 merge()를 사용하지 않습니까?

$data = array('name' => 'jimbob'); 

$User->Doctrine::getTable('User')->find(1); 

$User->merge($data); 

$User->save(); 
0

그래, 실제로 쿼리가 엉망입니다. 그것은 바보 같은 질문입니다!