Loading CHANGELOG.md +5 −0 Original line number Diff line number Diff line Loading @@ -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 ! Loading config/unicaen-db-import.global.php.dist +5 −4 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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 Loading src/UnicaenDbImport/Config/ConfigFactory.php +2 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -350,6 +351,7 @@ class ConfigFactory /** * @param string $connectionName * @return DbConnection|ApiConnection * * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface * @throws \UnicaenDbImport\Config\ConfigException Loading src/UnicaenDbImport/Connection/NoConnection.php 0 → 100644 +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 src/UnicaenDbImport/Domain/Destination.php +6 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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 Loading
CHANGELOG.md +5 −0 Original line number Diff line number Diff line Loading @@ -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 ! Loading
config/unicaen-db-import.global.php.dist +5 −4 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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 Loading
src/UnicaenDbImport/Config/ConfigFactory.php +2 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -350,6 +351,7 @@ class ConfigFactory /** * @param string $connectionName * @return DbConnection|ApiConnection * * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface * @throws \UnicaenDbImport\Config\ConfigException Loading
src/UnicaenDbImport/Connection/NoConnection.php 0 → 100644 +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
src/UnicaenDbImport/Domain/Destination.php +6 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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