Skip to content

Commit

Permalink
AKM-33: OroCommerce 5 LTS compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
dxops committed Mar 8, 2022
1 parent 746fbf2 commit a411656
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 19 deletions.
6 changes: 3 additions & 3 deletions Client/AkeneoClientFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Oro\Bundle\AkeneoBundle\Client;

use Akeneo\Pim\ApiClient\AkeneoPimClientBuilder;
use Akeneo\Pim\ApiClient\AkeneoPimClientInterface;
use Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientBuilder;
use Oro\Bundle\AkeneoBundle\Encoder\Crypter;
use Oro\Bundle\AkeneoBundle\Entity\AkeneoSettings;
use Oro\Bundle\EntityBundle\ORM\DoctrineHelper;
Expand Down Expand Up @@ -117,9 +117,9 @@ private function createClientByToken(): AkeneoPimClientInterface
return $this->client;
}

private function getClientBuilder(): AkeneoPimEnterpriseClientBuilder
private function getClientBuilder(): AkeneoPimClientBuilder
{
$clientBuilder = new AkeneoPimEnterpriseClientBuilder($this->akeneoUrl);
$clientBuilder = new AkeneoPimClientBuilder($this->akeneoUrl);
$clientBuilder->setHttpClient($this->httpClient);
$clientBuilder->setRequestFactory($this->requestFactory);
$clientBuilder->setStreamFactory($this->streamFactory);
Expand Down
28 changes: 28 additions & 0 deletions EntityConfig/ImportexportFieldConfiguration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace Oro\Bundle\AkeneoBundle\EntityConfig;

use Oro\Bundle\EntityConfigBundle\EntityConfig\FieldConfigInterface;
use Symfony\Component\Config\Definition\Builder\NodeBuilder;

/**
* Provides validations field config for importexport scope.
*/
class ImportexportFieldConfiguration implements FieldConfigInterface
{
public function getSectionName(): string
{
return 'importexport';
}

public function configure(NodeBuilder $nodeBuilder): void
{
$nodeBuilder
->scalarNode('source')
->info('`string` source of field.')
->end()
->scalarNode('source_name')
->info('`string` source name of field.')
->end();
}
}
1 change: 0 additions & 1 deletion Migrations/Schema/OroAkeneoBundleInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class OroAkeneoBundleInstaller implements Installation, ExtendExtensionAwareInte
*/
protected $options = [
'extend' => [
'origin' => ExtendScope::OWNER_CUSTOM,
'owner' => ExtendScope::OWNER_CUSTOM,
'state' => ExtendScope::STATE_NEW,
'is_serialized' => false,
Expand Down
1 change: 0 additions & 1 deletion Migrations/Schema/v1_12/OroAkeneoMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public function up(Schema $schema, QueryBag $queries)
'notnull' => false,
'oro_options' => [
'extend' => [
'origin' => ExtendScope::OWNER_CUSTOM,
'owner' => ExtendScope::OWNER_CUSTOM,
'state' => ExtendScope::STATE_NEW,
'is_serialized' => false,
Expand Down
20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ With this extension, you will be able to sync the following data from Akeneo to

## Compatibility

| Connector | Status | OroCommerce | Akeneo | Build |
|-----------|--------|-------------|----------------|-------|
| 1.6 | EOL | 1.6 | 2.3, 3.2, 4.0* | |
| 3.1 | EOL | 3.1 | 2.3, 3.2, 4.0* | |
| 4.1 | 2021 | 4.1 | 2.3, 3.2, 4.0* | [![Build Status](https://travis-ci.org/oroinc/OroAkeneoBundle.svg?branch=4.1)](https://travis-ci.org/oroinc/OroAkeneoBundle) |
| 4.2 | 2022 | 4.2 | 3.2, 4.0, 5.0 | [![Build Status](https://travis-ci.org/oroinc/OroAkeneoBundle.svg?branch=4.2)](https://travis-ci.org/oroinc/OroAkeneoBundle) |
| 5.0 | WIP | 5.0 | 4.0, 5.0 | |
| Connector | Status | OroCommerce | Akeneo |
|-----------|--------|-------------|----------------|
| 1.6 | EOL | 1.6 | 2.3, 3.2, 4.0* |
| 3.1 | EOL | 3.1 | 2.3, 3.2, 4.0* |
| 4.1 | EOL | 4.1 | 2.3, 3.2, 4.0* |
| 4.2 | 2022 | 4.2 | 3.2, 4.0, 5.0 |
| 5.0 | 2023 | 5.0 | 5.0+ |

** Akeneo supported using older client versions, new features are not available.**

Expand All @@ -31,11 +31,7 @@ With this extension, you will be able to sync the following data from Akeneo to
1. Add composer package

```
# Akeneo 4.0
composer require "oro/commerce-akeneo:4.2.*" "akeneo/api-php-client-ee:5.*"
# Akeneo 5.0
composer require "oro/commerce-akeneo:4.2.*" "akeneo/api-php-client-ee:6.*"
composer require "oro/commerce-akeneo:5.0.*"
```

2. Follow [Setup Guide](https://doc.oroinc.com/backend/setup/upgrade-to-new-version)
Expand Down
3 changes: 2 additions & 1 deletion Resources/config/importexport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,8 @@ services:
- [ setCacheProvider, [ '@oro_akeneo.importexport.cache' ] ]

oro_akeneo.importexport.cache:
class: Doctrine\Common\Cache\ArrayCache
parent: oro_cache.array_cache
public: false
calls:
- [ setNamespace, [ 'oro_akeneo' ] ]

Expand Down
5 changes: 5 additions & 0 deletions Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -400,3 +400,8 @@ services:
class: 'Oro\Bundle\AkeneoBundle\EventListener\DeletedAttributeRelationListener'
decorates: oro_serialized_fields.event_listener.deleted_attribute_relation_serialized
parent: oro_serialized_fields.event_listener.deleted_attribute_relation_serialized

oro_akeneo.entity_config.importexport_field_configuration:
class: Oro\Bundle\AkeneoBundle\EntityConfig\ImportexportFieldConfiguration
tags:
- oro_entity_config.validation.entity_config
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
},
"require": {
"oro/commerce": "5.0.*",
"akeneo/api-php-client-ee": "5.* || 6.*"
"akeneo/api-php-client": "8.*"
}
}

0 comments on commit a411656

Please sign in to comment.