2011-07-27 71 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”)

感谢反正答案。