Enrich headers list with an item.

@param array $headers
@param Item  $item
358652
private function enrichHeadersWithItem(
        array &$headers,
        Item $item
    ) {
        $this->enrichHeaderWithFields($headers, 'metadata', $item->getMetadata());
        $this->enrichHeaderWithFields($headers, 'indexed_metadata', $item->getIndexedMetadata());
        $this->enrichHeaderWithFields($headers, 'searchable_metadata', $item->getSearchableMetadata());
    }
114681
public function push($item)
    {
        $this->onBeforeInsert($item);
        $item->setContainerFieldList($this);

        return parent::push($item);
    }
1194742
public function setHeaders($headers)
    {
        // Set horizontal size of element
        $this->hSize = count($headers);
        $this->data('grid-size', $this->hSize);

        // Add headers
        $gridHeader = $this->appendSimpleRow($headers, 'DataTableHeader', $header = true);

        // Add checkable headers
        if ($this->checkable) {
            $this->appendCheckRow($gridHeader, null, false);
        }

        // Create new grid content wrapper
        $gridListContentWrapper = $this->getFormFactory()->buildHtmlElement('div', '', '', 'DataTableContentWrapper');
        $this->gridList->append($gridListContentWrapper);
        $this->gridList = $gridListContentWrapper;
    }
297907
protected function setHeaders(array $headers)
    {
        $this->headers = [];
        
        foreach ($headers as $name => $values) {
            $this->assertHeaderName($name);
            $this->assertHeaderValue($values);
        
            $key = strtolower($name);
            $this->headers[$key] = ['name' => $name, 'values' => (array)$values];
        }
    }
218526
public function addItem(Item $item)
    {
        if (!$this->items->contains($item)) {
            $this->items->add($item);
            $item->addLabel($this);
        }

        return $this;
    }
258858
protected function setImagesFromContent(Item $item)
    {
        $allImages = $this->getImages($item->getContent());
        $images = array();

        foreach ($allImages as $image) {
            if ($this->isOnIgnoredPatterns($image)) {
                continue;
            }
            $images[$image] = $image;
        }

        $item->setExtra('images', array_values($images));
    }
814293
private function initLoader($item, $key, ...$initLoaderArgs): void
    {
        $this->eventDispatcher->dispatch(new ItemEvent(EtlEvents::LOADER_INIT, $item, $key, $this));

        if (null === $this->init) {
            return;
        }

        ($this->init)(...$initLoaderArgs);
    }
256469
public function addItem(Item $item)
    {
        if (!$this->items->contains($item)) {
            $this->items->add($item);
            $item->setStorage($this);
        }

        return $this;
    }
829940
private function renderItem($item)
    {
        $this->response = $this->response->withBody(stream_for($this->getRenderedItem($item)));
    }
1170352
public function addItem(OrderingItem $item)
    {
        if (!$this->items->contains($item)) {
            $item->setQuestion($this);
            $this->items->add($item);
        }
    }
1006940
public function add($item)
    {
        $allItems = $this->getAll();
        if (is_array($item)) {
            $allItems = array_merge($allItems, $item);
        } else {
            $allItems[] = $item;
        }

        $this->setAll($allItems);
    }
437739
public function add_item(cc_i_item &$item) {
        if (is_null($this->itemlist)) {
            $this->itemlist = array();
        }
        $this->itemlist[$item->identifier] = $item;
    }
1353393
public function addItem(Item $item)
    {
        if (!$this->items->contains($item)) {
            $this->items->add($item);
            $item->setType($this);
        }

        return $this;
    }
1304721
public function add(AcceptHeaderItem $item) {

		$this->items[$item->getValue()] = $item;
		$this->sorted = FALSE;

		return $this;

	}
1282495
def with_headers(self, headers):
        
        for key, value in headers.items():
            self.with_header(key, value)
        return self
279222
protected function setItem($item, array $_deps)
    {
        $this->items[] = $item;
        foreach ($_deps as $_dep) {
            $this->items[]                 = $_dep;
            $this->dependsOn[$_dep][$item] = $item;
            $this->hits[$_dep]             = 0;
        }
        $this->items               = array_unique($this->items);
        $this->dependencies[$item] = $_deps;
        $this->hits[$item]         = 0;
    }
569037
public function addCorsHeaders($response, $headers)
    {
        if (empty($headers) === false) {
            foreach ($headers as $field => $value) {
                $response->setHeader($field, $value);
            }
        }
    }