@param \Generated\Shared\Transfer\BrandTransfer $brandTransfer

@return \Generated\Shared\Transfer\BrandResponseTransfer
493753
public function add(BrandTransfer $brandTransfer): BrandResponseTransfer
    {
        $brandEntity = $this->createFosBrandEntity($brandTransfer);
        $brandEntity->save();

        $brandTransfer->setIdBrand($brandEntity->getPrimaryKey());

        $brandResponseTransfer = new BrandResponseTransfer();
        $brandResponseTransfer
            ->setIsSuccess(true)
            ->setBrandTransfer($brandTransfer);

        return $brandResponseTransfer;
    }
829244
public function setStockTransfer(\Flowcode\ShopBundle\Entity\StockTransfer $stockTransfer = null)
    {
        $this->stockTransfer = $stockTransfer;

        return $this;
    }
451305
public function findByName(BrandTransfer $brandTransfer): ?BrandTransfer
    {
        try {
            $brandTransfer->requireName();
            return $this->get($brandTransfer);
        } catch (BrandNotFoundException $e) {
            return null;
        }
    }
1290327
public function recreateForNewResponseTransformer(ResponseTransformerInterface $responseTransformer): self
    {
        return new self($this->client, $responseTransformer, $this->apiExceptionTransformer, $this->accessToken);
    }
472546
protected function applyFilterToQuery(FosBrandQuery $fosBrandQuery, ?FilterTransfer $filterTransfer): FosBrandQuery
    {
        $criteria = new Criteria();
        if ($filterTransfer !== null) {
            $criteria = (new PropelFilterCriteria($filterTransfer))
                ->toCriteria();
        }

        $fosBrandQuery->mergeWith($criteria);

        return $fosBrandQuery;
    }
1184960
protected function updateResponseTransfer(AdyenApiResponseTransfer $responseTransfer, array $response): AdyenApiResponseTransfer
    {
        $apiResponseTransfer = (new AdyenApiRefundResponseTransfer())->fromArray($response, true);

        return $responseTransfer->setRefundResponse($apiResponseTransfer);
    }
904696
public function create(
        RestCompanyBusinessUnitsRequestAttributesTransfer $restCompanyBusinessUnitsRequestAttributesTransfer
    ): RestCompanyBusinessUnitsResponseTransfer {
        $companyBusinessUnitTransfer = new CompanyBusinessUnitTransfer();

        foreach ($this->companyBusinessUnitMapperPlugins as $companyBusinessUnitMapperPlugin) {
            $companyBusinessUnitTransfer = $companyBusinessUnitMapperPlugin->map(
                $restCompanyBusinessUnitsRequestAttributesTransfer,
                $companyBusinessUnitTransfer
            );
        }

        try {
            $companyBusinessUnitResponseTransfer = $this->companyBusinessUnitFacade->create($companyBusinessUnitTransfer);
        } catch (PropelException $e) {
            return $this->createCompanyBusinessUnitDataInvalidErrorResponse();
        }

        if (!$companyBusinessUnitResponseTransfer->getIsSuccessful()) {
            return $this->createCompanyBusinessUnitDataInvalidErrorResponse();
        }

        return $this->createCompanyBusinessUnitResponseTransfer(
            $companyBusinessUnitResponseTransfer->getCompanyBusinessUnitTransfer()
        );
    }
1242764
public function mapBrandTransfer(FosBrandEntityTransfer $brandEntityTransfer): BrandTransfer
    {
        $brandTransfer = new BrandTransfer();

        $brandTransfer->fromArray($brandEntityTransfer->toArray(), true);

        return $brandTransfer;
    }
1090076
protected function createCompanyBusinessUnitResponseTransfer(
        CompanyBusinessUnitTransfer $companyBusinessUnitTransfer
    ): RestCompanyBusinessUnitsResponseTransfer {
        $restCompanyBusinessUnitsResponseAttributesTransfer = new RestCompanyBusinessUnitsResponseAttributesTransfer();

        $restCompanyBusinessUnitsResponseAttributesTransfer->fromArray(
            $companyBusinessUnitTransfer->toArray(),
            true
        );

        $restCompanyBusinessUnitsResponseTransfer = new RestCompanyBusinessUnitsResponseTransfer();

        $restCompanyBusinessUnitsResponseTransfer->setIsSuccess(true)
            ->setRestCompanyBusinessUnitsResponseAttributes($restCompanyBusinessUnitsResponseAttributesTransfer);

        return $restCompanyBusinessUnitsResponseTransfer;
    }
435840
public function getActiveBrands(): BrandCollectionTransfer
    {
        $query = $this->getFactory()
            ->createBrandQuery()
            ->filterByIsActive(true);

        $brandEntityCollectionTransfer = $this->buildQueryFromCriteria($query)->find();

        return $this->getFactory()->createBrandMapper()->mapCollectionTransfer($brandEntityCollectionTransfer);
    }
147942
public function filter(RabbitMqExchangeCollectionTransfer $rabbitMqExchangeCollectionTransfer)
    {
        $filteredRabbitMqExchangeCollectionTransfer = new RabbitMqExchangeCollectionTransfer();

        foreach ($rabbitMqExchangeCollectionTransfer->getRabbitMqExchanges() as $rabbitMqExchangeTransfer) {
            if (!$this->isBlacklisted($rabbitMqExchangeTransfer)) {
                $filteredRabbitMqExchangeCollectionTransfer->addRabbitMqExchange($rabbitMqExchangeTransfer);
            }
        }

        return $filteredRabbitMqExchangeCollectionTransfer;
    }
671899
public function findById(BrandTransfer $brandTransfer): ?BrandTransfer
    {
        try {
            $brandTransfer->requireIdBrand();
            return $this->get($brandTransfer);
        } catch (BrandNotFoundException $e) {
            return null;
        }
    }
1085695
public function getFile(PayoneGetFileTransfer $getFileTransfer)
    {
        $responseContainer = new GetFileResponseContainer();
        $paymentEntity = $this->findPaymentByFileReferenceAndCustomerId(
            $getFileTransfer->getReference(),
            $getFileTransfer->getCustomerId()
        );

        if ($paymentEntity) {
            /** @var \SprykerEco\Zed\Payone\Business\Payment\MethodMapper\DirectDebit $paymentMethodMapper */
            $paymentMethodMapper = $this->getRegisteredPaymentMethodMapper(PayoneApiConstants::PAYMENT_METHOD_DIRECT_DEBIT);
            $requestContainer = $paymentMethodMapper->mapGetFile($getFileTransfer);
            $this->setStandardParameter($requestContainer);
            $rawResponse = $this->executionAdapter->sendRequest($requestContainer);
            $responseContainer->init($rawResponse);
        } else {
            $this->setAccessDeniedError($responseContainer);
        }

        $getFileTransfer->setRawResponse($responseContainer->getRawResponse());
        $getFileTransfer->setStatus($responseContainer->getStatus());
        $getFileTransfer->setErrorCode($responseContainer->getErrorcode());
        $getFileTransfer->setCustomerErrorMessage($responseContainer->getCustomermessage());
        $getFileTransfer->setInternalErrorMessage($responseContainer->getErrormessage());

        return $getFileTransfer;
    }
1349166
public function request(AdyenApiRequestTransfer $requestTransfer): AdyenApiResponseTransfer
    {
        $requestData = $this->mapper->buildRequestArray($requestTransfer);
        $isSuccess = true;

        try {
            $response = $this->adapter->sendRequest($requestData);
        } catch (RequestException $requestException) {
            $response = $requestException->getResponse();
            $isSuccess = false;
        }

        return $this->converter->convertToResponseTransfer($response, $isSuccess);
    }
132643
public function mapBrand(FosBrand $fosBrand, BrandTransfer $brandTransfer): BrandTransfer
    {
        $brandTransfer->fromArray($fosBrand->toArray(), true);
        return $brandTransfer;
    }
599123
public function getCaptureResponseTransfer(CaptureResponseContainer $responseContainer)
    {
        $result = new CaptureResponseTransfer();
        $clearing = new ClearingTransfer();
        $creditor = new CreditorTransfer();
        $baseResponse = new BaseResponseTransfer();

        // Fill clearing transfer
        $clearing->setBankAccountHolder($responseContainer->getClearingBankaccountholder());
        $clearing->setBankCountry($responseContainer->getClearingBankcountry());
        $clearing->setBankAccount($responseContainer->getClearingBankaccount());
        $clearing->setBankCode($responseContainer->getClearingBankcode());
        $clearing->setBankIban($responseContainer->getClearingBankiban());
        $clearing->setBankBic($responseContainer->getClearingBankbic());
        $clearing->setBankCity($responseContainer->getClearingBankcity());
        $clearing->setBankName($responseContainer->getClearingBankname());
        $clearing->setLegalNote($responseContainer->getClearingLegalnote());
        $clearing->setDate($responseContainer->getClearingDate());
        $clearing->setDueDate($responseContainer->getClearingDuedate());
        $clearing->setReference($responseContainer->getClearingReference());
        $clearing->setInstructionNote($responseContainer->getClearingInstructionnote());
        $clearing->setAmount($responseContainer->getClearingAmount());

        // Fill creditor transfer
        $creditor->setIdentifier($responseContainer->getCreditorIdentifier());
        $creditor->setName($responseContainer->getCreditorName());
        $creditor->setStreet($responseContainer->getCreditorStreet());
        $creditor->setZip($responseContainer->getCreditorZip());
        $creditor->setCity($responseContainer->getCreditorCity());
        $creditor->setCountry($responseContainer->getCreditorCountry());
        $creditor->setEmail($responseContainer->getCreditorEmail());

        // Fill base response transfer
        $baseResponse->setErrorCode($responseContainer->getErrorcode());
        $baseResponse->setErrorMessage($responseContainer->getErrormessage());
        $baseResponse->setCustomerMessage($responseContainer->getCustomermessage());
        $baseResponse->setStatus($responseContainer->getStatus());
        $baseResponse->setRawResponse($responseContainer->getRawResponse());

        // Set plain attributes
        $result->setTxid($responseContainer->getTxid());
        $result->setSettleAccount($responseContainer->getSettleaccount());
        $result->setMandateIdentification($responseContainer->getMandateIdentification());

        // Set aggregated transfers
        $result->setClearing($clearing);
        $result->setCreditor($creditor);
        $result->setBaseResponse($baseResponse);

        return $result;
    }
297422
protected function hydrateQuoteWithCustomer(
        QuoteTransfer $quoteTransfer,
        PayonePaypalExpressCheckoutGenericPaymentResponseTransfer $details
    ) {
        $customerEmail = $details->getEmail();
        $customerTransfer = new CustomerTransfer();
        $customerTransfer->setEmail($customerEmail);
        $customerTransfer = $this->customerClient->getCustomerByEmail($customerTransfer);

        if (!empty($customerTransfer->getFirstName())) {
            $quoteTransfer->setCustomer($customerTransfer);
            return $quoteTransfer;
        }
        $customerTransfer->setIsGuest(true);
        $customerTransfer->setFirstName($details->getShippingFirstName());
        $customerTransfer->setLastName($details->getShippingLastName());
        $customerTransfer->setCompany($details->getShippingCompany());
        $customerTransfer->setEmail($customerEmail);
        $quoteTransfer->setCustomer($customerTransfer);

        return $quoteTransfer;
    }