mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Finish refactoring mapping creation
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Alchemy\Phrasea\SearchEngine\Elastic\Structure;
|
||||
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\FieldMapping;
|
||||
use Alchemy\Phrasea\SearchEngine\Elastic\Mapping;
|
||||
use Assert\Assertion;
|
||||
use DomainException;
|
||||
@@ -76,12 +77,15 @@ final class GlobalStructure implements Structure
|
||||
Assertion::allIsInstanceOf($fields, Field::class);
|
||||
Assertion::allIsInstanceOf($flags, Flag::class);
|
||||
Assertion::allIsInstanceOf($metadata_tags, Tag::class);
|
||||
|
||||
foreach ($fields as $field) {
|
||||
$this->add($field);
|
||||
}
|
||||
|
||||
foreach ($flags as $flag) {
|
||||
$this->flags[$flag->getName()] = $flag;
|
||||
}
|
||||
|
||||
foreach ($metadata_tags as $tag) {
|
||||
$this->metadata_tags[$tag->getName()] = $tag;
|
||||
}
|
||||
@@ -97,7 +101,7 @@ final class GlobalStructure implements Structure
|
||||
|
||||
$this->fields[$name] = $field;
|
||||
|
||||
if ($field->getType() === Mapping::TYPE_DATE) {
|
||||
if ($field->getType() === FieldMapping::TYPE_DATE) {
|
||||
$this->date_fields[$name] = $field;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user