Commit fb880d35 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Merge des évolutions réalisées dans la v6.2.0

parents a5c29024 bc80983c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -5,6 +5,11 @@ Changelog
-----
- Requiert la bibliotèque unicaen/privilege.

6.2.0
-----
- Nouveau type de connexion NoConnection : non-connexion pour laquelle les données sont spécifiées manuellement sous forme d'un tableau.
- Clarification et refactorisation des ColumnValueFilter.

6.1.4
-----
- [FIX] Interrogation de IMPORT_OBSERV (table des changements de valeurs à détecter) : upper() était indispensable ! 
+5 −4
Original line number Diff line number Diff line
@@ -89,9 +89,9 @@ return [
                    // - tableau associatif spécifiant le filtre et paramètres de génération de la valeur.
                    //'computed_columns' => [
                    //    'sourceCode' => 'code', // la colonne calculée 'sourceCode' aura la même valeur que la colonne 'code'
                    //    //'libelleCourt' => ['name' => SameColumnValueFilter::class, 'params' => ['column' => 'code']],
                    //    //'libelleLong' => ['name' => ConcatColumnValueFilter::class, 'params' => ['columns' => ['code','libelleLong']]],
                    //    //'libelleLong' => ['name' => ConcatColumnValueFilter::class, 'params' => ['columns' => ['code',' : ','libelleLong'], 'separator' => '']],
                    //    //['name' => SameColumnValueFilter::class, 'params' => ['column' => 'nomUsuel', 'source_column' => 'nomPatronymique']],
                    //    //['name' => ConcatColumnValueFilter::class, 'params' => ['column' => 'libelleLong', 'columns' => ['code','libelleLong']]],
                    //    //['name' => ConcatColumnValueFilter::class, 'params' => ['column' => 'libelleLong', 'columns' => ['code',': ','libelleLong'], 'separator' => '']],
                    //],

                    // Filtres à appliquer pour transformer des valeurs de colonnes/attributs issues de la source
@@ -99,7 +99,8 @@ return [
                    // Tableau ordonné de services ou de classes implémentant obligatoirement l'interface
                    // {@see \UnicaenDbImport\Filter\ColumnValue\ColumnValueFilterInterface}.
                    'column_value_filter' => [
                        // ['name' => ToLowercaseColumnValueFilter::class, 'params' => ['columns' => ['code']]]
                        // ['name' => ToLowercaseColumnValueFilter::class, 'params' => ['column' => 'code']],
                        // ['name' => SameColumnValueFilter::class, 'params' => ['column' => 'nomUsuel', 'source_column' => 'nomPatronymique']],
                    ],

                    // Spécification du filtre à utiliser pour transformer chaque nom de colonne/attribut source en
+2 −0
Original line number Diff line number Diff line
@@ -174,6 +174,7 @@ class ConfigFactory
    /**
     * @param string|array $value
     * @return DbConnection|ApiConnection
     *
     * @throws \Psr\Container\ContainerExceptionInterface
     * @throws \Psr\Container\NotFoundExceptionInterface
     * @throws \UnicaenDbImport\Config\ConfigException
@@ -350,6 +351,7 @@ class ConfigFactory
    /**
     * @param string $connectionName
     * @return DbConnection|ApiConnection
     *
     * @throws \Psr\Container\ContainerExceptionInterface
     * @throws \Psr\Container\NotFoundExceptionInterface
     * @throws \UnicaenDbImport\Config\ConfigException
+28 −0
Original line number Diff line number Diff line
<?php

namespace UnicaenDbImport\Connection;

/**
 * Non-connexion pour laquelle les données sont spécifiées manuellement sous forme d'un tableau.
 */
class NoConnection
{
    private array $data = [];

    public function __construct(array $data)
    {
        $this->setData($data);
    }

    public function setData(array $data): self
    {
        $this->data = $data;

        return $this;
    }

    public function getData(): array
    {
        return $this->data;
    }
}
 No newline at end of file
+6 −2
Original line number Diff line number Diff line
@@ -52,7 +52,11 @@ class Destination implements DestinationInterface
        try {
            $inst->validateConfig();
        } catch (\InvalidArgumentException $e) {
            throw new ConfigException(sprintf("Config Destination '%s' invalide : %s", $config['name'] ?? null, $e->getMessage()));
            throw new ConfigException(
                sprintf("Config Destination '%s' invalide : %s", $config['name'] ?? null, $e->getMessage()),
                null,
                $e
            );
        }

        return $inst;
@@ -185,7 +189,7 @@ class Destination implements DestinationInterface

    public function getColumnValueFilter(): array
    {
        return $this->config->get('column_value_filter');
        return $this->config->get('column_value_filter', []);
    }

    public function getIdColumnStrategy(): ?string
Loading