Hello I have got this php order by annotations on my one to many relationship
/**
* 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;
And I got this error:
Uncaught exception 'Doctrine\Common\Annotations\AnnotationException' with message '[Syntax Error] Expected Doctrine\Common\Annotations\Lexer::T_CLOSE_PARENTHESIS, got 'order' at position 108
Anyone got similar issue? Any advise will be greatly appreciated.
oops sorry I think I know the mistake it it’s the double quote
@OneToMany(targetEntity=”Task”, mappedBy=”taskCategory””)
suppose to be
@OneToMany(targetEntity=”Task”, mappedBy=”taskCategory”)
thanks for the answer anyway.