Skip to content

Commit

Permalink
Merge pull request #88 from Flowpack/allow-index-prefix-from-settings
Browse files Browse the repository at this point in the history
FEATURE: Allow configuring a prefix for the index name via Settings
  • Loading branch information
jonnitto committed Dec 8, 2022
2 parents 3c5a287 + b8a4f9c commit c771c63
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Classes/Domain/Model/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ public function __construct(string $name, Client $client = null)
public function injectSettings(array $settings): void
{
$this->settings = $settings;
$indexSettings = $this->getSettings();
if (!isset($indexSettings['prefix']) || empty($indexSettings['prefix'])) {
return;
}
// This is obviously a side effect but can only be done after injecting settings
// and it needs to be done as early as possible
$this->name = $settings['prefix'] . '-' . $this->name;
}

/**
Expand Down

0 comments on commit c771c63

Please sign in to comment.