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

Ability to extend PHP API Client #71

Open
syno-dlr opened this issue Oct 6, 2017 · 1 comment
Open

Ability to extend PHP API Client #71

syno-dlr opened this issue Oct 6, 2017 · 1 comment

Comments

@syno-dlr
Copy link

syno-dlr commented Oct 6, 2017

Hello Akeneo Team,

We created a custom entry point on Akeneo 2.0. Today, I would like to use php api client to work with this entry point but it seems that the client is "closed" to Akeneo services.

It could be cool to add the ability to extend the API with something like AkeneoPimClientBuilder::addEntryPoint(....) ? Or with some configuration files...

Best Regards,

Dam'.

@LevFlavien
Copy link
Contributor

LevFlavien commented Jun 3, 2022

This is not a planned feature, but extending the client can be achieved by simply extending AkeneoPimClient class.

final class CustomPimClient extends AkeneoPimClient
{
    private CustomApi $customApi;

    public function __construct(
        Authentication $authentication,
        ProductApiInterface $productApi,
        /* ... */
        CustomApi $customApi
    ) {
        parent::__construct(
            $authentication,
            $productApi,
            /* ... */
        );

        $this->customApi = $customApi;
    }

    public function customApi(): CustomApi
    {
        return $this->customApi;
    }
}

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

No branches or pull requests

3 participants