protected function addElementsToIndexes($elements, array $indexes): void
    {
        if (!is_array($elements)) {
            $elements = [$elements];
        }

        /** @var DescriptorAbstract $element */
        foreach ($elements as $element) {
            /** @var Collection $collection */
            foreach ($indexes as $collection) {
                $collection->set($this->getIndexKey($element), $element);
            }
        }
    }
protected function addElementsToIndexes($elements, array $indexes): void
    {
        if (!is_array($elements)) {
            $elements = [$elements];
        }

        /** @var DescriptorAbstract $element */
        foreach ($elements as $element) {
            /** @var Collection $collection */
            foreach ($indexes as $collection) {
                $collection->set($this->getIndexKey($element), $element);
            }
        }
    }
protected function addElementsToIndexes ( $ elements , array $ indexes ) : void { if ( ! is_array ( $ elements ) ) { $ elements = [ $ elements ] ; } /** @var DescriptorAbstract $element */ foreach ( $ elements as $ element ) { /** @var Collection $collection */ foreach ( $ indexes as $ collection ) { $ collection -> set ( $ this -> getIndexKey ( $ element ) , $ element ) ; } } }
Adds a series of descriptors to the given list of collections.

@param DescriptorAbstract|DescriptorAbstract[] $elements
@param Collection[]                            $indexes
Adds a series of descriptors to the given list of collections .