• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Link/Url/UrlCollection.php
  • Класс: BitrixImV2LinkUrlUrlCollection
  • Вызов: UrlCollection::fillMetadata
public function fillMetadata(bool $withHtml = true): self
{
	$previewUrlsIds = $this->getEntityIds();

	$entities = BitrixImV2EntityUrlUrlCollection::initByPreviewUrlsIds($previewUrlsIds, $withHtml);

	foreach ($this as $url)
	{
		if ($entities->getById($url->getEntityId()) !== null)
		{
			$url->setEntity($entities->getById($url->getEntityId()));
		}
		else
		{
			$url->setEntity((new EntityUrlUrlItem())->setUrl($url->getUrl()));
		}
	}

	return $this;
}