2011-01-14 2 views
1

내가이 쿼리를 실행하려고 그러나교리 관계 문제

$record = Doctrine_Query::create() 
         ->select('m.*') 
         ->from('Modification m') 
         ->leftJoin('m.Location l') 
         ->leftJoin('l.Site s') 
         ->where('CONCAT(s.baseUrl, s.modUrlPrefix, l.urlSuffix) = ?', (string)$url) 
         ->fetchOne(); 

, 그것은 오류와 함께 실패

Doctrine_Table_Exception 다음에 알 수없는 관계 별명 위치

관계 yaml 파일은 다음과 같이 보입니다 (2 개의 1 대 다수 관계. 수정 및 사이트 모두에 많은 위치가 있음) :

Site: 
    columns: 
     id: 
      type: integer 
      primary: true 
      autoincrement: true 

Modification: 
    columns: 
     id: 
      type: integer 
      primary: true 
      autoincrement: true 

Location: 
    columns: 
     modification_id: integer 
     site_id: integer 
    relations: 
     Modification: 
      foreignAlias: Locations 
     Site: 
      foreignAlias: Locations 
     Category: 
      foreignAlias: Locations 

내가 필요로하는 yaml 파일에는 무엇을 넣지 않습니까? 내가 할 수있는 한, yaml 파일은 문서에서 제안한 것과 동일하게 설정되어 있습니다.

답변

2

m.Locations 아니요? 내가 결코 YAML 파일을 읽을 수 없습니다, 그래서

+0

당신은 내가 항상 요청 후 매우 어리석은 생각하는 질문을 알고 확실하지 않다

Modification: foreignAlias: Locations 

당신 YAML의 특별한 경우의이 별명이 아닌 위치? 이것은 그들 중 하나입니다. 나는 너무나 명백한 것을 놓친다는 것을 믿을 수 없다. 많은 감사합니다. – Yacoby