• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Dto/Property.php
  • Класс: Bitrix\Crm\Dto\Property
  • Вызов: Property::getValue
public function getValue($object = null)
{
	$origValue = $this->property->getValue($object);
	if (is_array($origValue))
	{
		$serializedValue = [];
		foreach ($origValue as $k => $item)
		{
			if ($item instanceof Dto)
			{
				$serializedValue[$k] = $item->jsonSerialize();
			}
			else
			{
				$serializedValue[$k] = $item;
			}
		}
	}
	elseif ($origValue instanceof Dto)
	{
		$serializedValue = $origValue->jsonSerialize();
	}
	else
	{
		$serializedValue = $origValue;
	}

	return $serializedValue;
}