php-etl/akeneo-plugin

Adapters for the Akeneo API client


License
MIT

Documentation

Akeneo Data Flows

Principles

This package aims at integration the Akeneo PHP clients into the Pipeline stack. This integration is compatible with both akeneo/api-php-client-ee and akeneo/api-php-client.

The tools in this library will produce an AST using nikic/php-parser that you will be able to print in order to have some generated optimized glue code.

Configuration format

Usage

This library will build for you either an extractor or a loader, compatible with the Akeneo API.

echo (new PhpParser\PrettyPrinter\Standard())->prettyPrintFile([
    new \PhpParser\Node\Stmt\Expression(
        (new \Kiboko\Component\ETL\Flow\Akeneo\Service())
            ->compile([
                'akeneo' => [
                    'enterprise' => true,
                    'extractor' => [
                        'type' => 'productModel',
                        'method' => 'all',
                        'search' => [
                            [
                                'field' => 'enabled',
                                'operator' => '=',
                                'value' => true,
                            ],
                            [
                                'field' => 'completeness',
                                'operator' => '>',
                                'value' => 70,
                                'scope' => 'ecommerce',
                            ],
                            [
                                'field' => 'completeness',
                                'operator' => '<',
                                'value' => 85,
                                'scope' => 'ecommerce',
                            ],
                            [
                                'field' => 'categories',
                                'operator' => 'IN',
                                'value' => 'winter_collection',
                            ],
                            [
                                'field' => 'family',
                                'operator' => 'IN',
                                'value' => ['camcorders', 'digital_cameras'],
                            ],
                        ]
                    ],
                    'client' => [
                        'context' => [
                            'http_client' => 'Http\\Mock\\Client',
                            'http_request_factory' => 'Foo\\Mock\\RequestFactory::bar',
                            'http_stream_factory' => 'Foo\\Mock\\StreamFactory::foo',
                            'filesystem' => 'Foo\\Mock\\Filesystem',
                        ],
                        'api_url' => 'https://demo.akeneo.com',
                        'client_id' => '1234567890',
                        'secret' => 'qwertyuiop',
                        'username' => 'johndoe',
                        'password' => 'lkjhgfdsa',
                    ],
                ],
            ])->getNode(),
        )
    ]);

See also