private function getNodeTranslationForSlugPart(
        NodeTranslation $parentNode = null,
        $slugPart = ''
    ) {
        $qb = $this->createQueryBuilder('t')
            ->select('t', 'v', 'n')
            ->innerJoin('t.node', 'n', 'WITH', 't.node = n.id')
            ->leftJoin(
                't.publicNodeVersion',
                'v',
                'WITH',
                't.publicNodeVersion = v.id'
            )
            ->where('n.deleted != 1')
            ->setFirstResult(0)
            ->setMaxResults(1);

        if ($parentNode !== null) {
            $qb->andWhere('t.slug = :slug')
                ->andWhere('n.parent = :parent')
                ->setParameter('slug', $slugPart)
                ->setParameter('parent', $parentNode->getNode()->getId());
        } else {
            /* if parent is null we should look for slugs that have no parent */
            $qb->andWhere('n.parent IS NULL');
            if (empty($slugPart)) {
                $qb->andWhere('t.slug is NULL');
            } else {
                $qb->andWhere('t.slug = :slug');
                $qb->setParameter('slug', $slugPart);
            }
        }

        return $qb->getQuery()->getOneOrNullResult();
    }