protected function findOrphanedIds(): array
    {
        $queryBuilder = $this->entityManager->createQueryBuilder();
        $queryBuilder->select('i.id AS id')
                     ->from(Item::class, 'i')
                     ->leftJoin('i.modCombinations', 'mc')
                     ->leftJoin(RecipeIngredient::class, 'ri', 'WITH', 'ri.item = i.id')
                     ->leftJoin(RecipeProduct::class, 'rp', 'WITH', 'rp.item = i.id')
                     ->andWhere('mc.id IS NULL')
                     ->andWhere('ri.item IS NULL')
                     ->andWhere('rp.item IS NULL');

        $result = [];
        foreach ($queryBuilder->getQuery()->getResult() as $data) {
            $result[] = (int) $data['id'];
        }
        return $result;
    }