Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Doctrine orm 博士2一人一人计数_Doctrine Orm_Doctrine - Fatal编程技术网

Doctrine orm 博士2一人一人计数

Doctrine orm 博士2一人一人计数,doctrine-orm,doctrine,Doctrine Orm,Doctrine,我有两个实体:用户和注释 在用户中,您有: /** * @ORM\OneToMany(targetEntity="Comment", mappedBy="User", cascade={"persist", "remove"}) * @ORM\OrderBy({"sort_priority" = "ASC"}) */ private $Comments; 在我的自定义类中,我有一个查询: $query = 'SELECT u from BackendUse

我有两个实体:用户和注释

在用户中,您有:

/**
     * @ORM\OneToMany(targetEntity="Comment", mappedBy="User", cascade={"persist", "remove"})
     * @ORM\OrderBy({"sort_priority" = "ASC"})
     */
    private $Comments;
在我的自定义类中,我有一个查询:

$query = 'SELECT u from BackendUserBundle:User u WHERE u.status != 0';

此查询返回所有用户,但我希望返回计数(注释)>0的用户。我不能使用
Join
,因为我使用了
iterate()

createQuery('从CmsUser u中选择u,其中 大小(美国电话号码)>1’$用户=$query->getResult()