src/Repository/ItemRepository.php
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;
    }
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;
    }
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 ; }
Returns the ids of orphaned machines, which are no longer used by any recipe or combination.
@return array|int[]
Returns the ids of orphaned machines which are no longer used by any recipe or combination .