Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to a member function toArray() on array #783

Open
TonyMarston opened this issue Sep 14, 2024 · 1 comment
Open

Call to a member function toArray() on array #783

TonyMarston opened this issue Sep 14, 2024 · 1 comment

Comments

@TonyMarston
Copy link

Problem description:

Error:

Uncaught exception from Error, message = Call to a member function toArray() on array, code=0, file=F:\Apache2\HTDOCS\GMX-Transix\includes\vendor\jlevers\selling-partner-api\src\Traits\HasArrayableAttributes.php, line=68

Code

require_once('vendor/autoload.php');
use SellingPartnerApi\SellingPartnerApi;
use SellingPartnerApi\Enums\Endpoint;
use SellingPartnerApi\Seller\APlusContentV20201101\Dto;

$connector = SellingPartnerApi::seller(
    clientId: $client_id,
    clientSecret: $client_secret,
    refreshToken: $refresh_token,
    endpoint: Endpoint::{$endpoint}
);

$api = $connector->aPlusContentV20201101();

try {
    $result = $api->validateContentDocumentAsinRelations(
        marketplaceId: $marketplace_id,
        postContentDocumentRequest: new Dto\PostContentDocumentRequest(new Dto\ContentDocument($name,
                                                                                               $contentType,
                                                                                               $locale,
                                                                                               $contentModuleList,
                                                                                               $contentSubType)));
} catch (Exception $e) {
    echo 'Exception when calling aPlusContentV20201101->validateContentDocumentAsinRelations: ',
        $e->getMessage(),
        PHP_EOL;
};

The code appears to fail when processing the $contentModuleList argument, but as this is already an array why is it failing?

@a-diessner
Copy link

I'm in similar problems. Have you found a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants