2011-07-27 69 views
4

你好,我已經通過註解我一個得到這個PHP以一對多的關係學說2,一對多的關係排序依據註解

/** 
    * TaskCategory 
    * 
    * @Table(name="task_category") 
    * @Entity(repositoryClass="models\Repositories\TaskCategoryRepository") 
    */ 
class TaskCategory 
{ 
/** 
    * @var array $tasks 
    * 
    * @OneToMany(targetEntity="Task", mappedBy="taskCategory"") 
    * @OrderBy({"sort_order" = "ASC"}) 
    */ 
    private $tasks; 

而且我得到了這個錯誤:

Uncaught exception 'Doctrine\Common\Annotations\AnnotationException' with message '[Syntax Error] Expected Doctrine\Common\Annotations\Lexer::T_CLOSE_PARENTHESIS, got 'order' at position 108 

任何人都得到了類似的問題?任何意見將不勝感激。

回答

3

哎呀對不起,我想我知道錯了,它被雙引號 @OneToMany(targetEntity = 「任務」,的mappedBy = 「taskCategory」 「) 假設是 @OneToMany(targetEntity =」 任務」,的mappedBy = 「taskCategory」)

感謝反正答案。