customerIdsParameterIsMissing example

'message' => 'Customer is not logged in.',
        ];

        yield CustomerException::LINE_ITEM_DOWNLOAD_FILE_NOT_FOUND => [
            'exception' => CustomerException::downloadFileNotFound('id-1'),
            'statusCode' => Response::HTTP_NOT_FOUND,
            'errorCode' => CustomerException::LINE_ITEM_DOWNLOAD_FILE_NOT_FOUND,
            'message' => 'Line item download file with id "id-1" not found.',
        ];

        yield CustomerException::CUSTOMER_IDS_PARAMETER_IS_MISSING => [
            'exception' => CustomerException::customerIdsParameterIsMissing(),
            'statusCode' => Response::HTTP_BAD_REQUEST,
            'errorCode' => CustomerException::CUSTOMER_IDS_PARAMETER_IS_MISSING,
            'message' => 'Parameter "customerIds" is missing.',
        ];

        yield CustomerException::CUSTOMER_ADDRESS_NOT_FOUND => [
            'exception' => CustomerException::addressNotFound('id-1'),
            'statusCode' => Response::HTTP_BAD_REQUEST,
            'errorCode' => CustomerException::CUSTOMER_ADDRESS_NOT_FOUND,
            'message' => 'Customer address with id "id-1" not found.',
        ];

        

    private function getRequestCustomerIds(Request $request): array
    {
        $customerIds = $request->request->all('customerIds');

        if (!empty($customerIds)) {
            $customerIds = array_unique($customerIds);
        }

        if (empty($customerIds)) {
            throw CustomerException::customerIdsParameterIsMissing();
        }

        return $customerIds;
    }

    /** * @param array<string> $customerIds * * @return array<CustomerEntity> */
    private function fetchCustomers(array $customerIds, Context $context, bool $silentError = false): array
    {
Home | Imprint | This part of the site doesn't use cookies.