public function filterByInAnyGroup($groups, $inGroups = true)
    {
        $this->checkGroupJoin();
        $groupIDs = [];
        $orX = $this->getQueryObject()->expr()->orX();
        $app = Application::getFacadeApplication();
        /** @var $likeBuilder LikeBuilder */
        $likeBuilder = $app->make(LikeBuilder::class);
        $query = $this->getQueryObject()->getConnection()->createQueryBuilder();

        foreach ($groups as $group) {
            if ($group instanceof \Concrete\Core\User\Group\Group) {
                $orX->add($this->getQueryObject()->expr()->like('g.gPath', ':groupPathChild_'.$group->getGroupID()));
                $this->getQueryObject()->setParameter('groupPathChild_'.$group->getGroupID(), $likeBuilder->escapeForLike($group->getGroupPath()). '/%');

                $groupIDs[] = $group->getGroupID();
            }
        }
        if (is_array($groups) && count($groups) > 0) {
            $query->select('u.uID')->from('Users','u')
                ->leftJoin('u','UserGroups','ug','u.uID=ug.uID')
                ->leftJoin('ug', $query->getConnection()->getDatabasePlatform()->quoteSingleIdentifier('Groups'), 'g', 'ug.gID=g.gID');
            $orX->add($this->getQueryObject()->expr()->in('g.gID', $groupIDs));
            $query->where($orX)->andWhere($this->getQueryObject()->expr()->isNotNull('g.gID'));
            if ($inGroups) {
                $this->getQueryObject()->andWhere($this->getQueryObject()->expr()->in('u.uID', $query->getSQL()));
            } else {
                $this->getQueryObject()->andWhere($this->getQueryObject()->expr()->notIn('u.uID', $query->getSQL()));
                $this->getQueryObject()->setParameter('groupIDs',$groupIDs, \Concrete\Core\Database\Connection\Connection::PARAM_INT_ARRAY);
            }
        }



    }