Components/Bundle/ShopwareAdapter/CommandHandler/HandleBundleCommandHandler.php
private function getCustomerGroupFromPrice(Price $price)
    {
        $repository = $this->entityManager->getRepository(GroupModel::class);

        if (null === $price->getCustomerGroupIdentifier()) {
            return $repository->findOneBy(['key' => 'EK']);
        }

        $identity = $this->identityService->findOneBy(
            [
                'objectIdentifier' => (string) $price->getCustomerGroupIdentifier(),
                'objectType' => CustomerGroup::TYPE,
                'adapterName' => ShopwareAdapter::NAME,
            ]
        );

        if (null === $identity) {
            return null;
        }

        return $repository->find($identity->getAdapterIdentifier());
    }
private function getCustomerGroupFromPrice(Price $price)
    {
        $repository = $this->entityManager->getRepository(GroupModel::class);

        if (null === $price->getCustomerGroupIdentifier()) {
            return $repository->findOneBy(['key' => 'EK']);
        }

        $identity = $this->identityService->findOneBy(
            [
                'objectIdentifier' => (string) $price->getCustomerGroupIdentifier(),
                'objectType' => CustomerGroup::TYPE,
                'adapterName' => ShopwareAdapter::NAME,
            ]
        );

        if (null === $identity) {
            return null;
        }

        return $repository->find($identity->getAdapterIdentifier());
    }
private function getCustomerGroupFromPrice ( Price $ price ) { $ repository = $ this -> entityManager -> getRepository ( GroupModel :: class ) ; if ( null === $ price -> getCustomerGroupIdentifier ( ) ) { return $ repository -> findOneBy ( [ 'key' => 'EK' ] ) ; } $ identity = $ this -> identityService -> findOneBy ( [ 'objectIdentifier' => ( string ) $ price -> getCustomerGroupIdentifier ( ) , 'objectType' => CustomerGroup :: TYPE , 'adapterName' => ShopwareAdapter :: NAME , ] ) ; if ( null === $ identity ) { return null ; } return $ repository -> find ( $ identity -> getAdapterIdentifier ( ) ) ; }
@param Price $price

@return null|GroupModel
@param Price $price