• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/activity/entity/configurablerestapp/dto/contentblockdto.php
  • Класс: Bitrix\Crm\Activity\Entity\ConfigurableRestApp\Dto\ContentBlockDto
  • Вызов: ContentBlockDto::getCastByPropertyName
public function getCastByPropertyName(string $propertyName): ?\Bitrix\Crm\Dto\Caster
{
	if ($propertyName !== 'properties')
	{
		return null;
	}

	$typeToClassnameMap = [
		self::TYPE_TEXT => Dto\ContentBlock\TextDto::class,
		self::TYPE_LARGE_TEXT => Dto\ContentBlock\LargeTextDto::class,
		self::TYPE_LINK => Dto\ContentBlock\LinkDto::class,
		self::TYPE_DEADLINE => Dto\ContentBlock\DeadlineDto::class,
		self::TYPE_WITH_TITLE => Dto\ContentBlock\WithTitleDto::class,
		self::TYPE_LINE_OF_BLOCKS => Dto\ContentBlock\LineOfBlocksDto::class,
	];

	return $typeToClassnameMap[$this->type]
		? new \Bitrix\Crm\Dto\Caster\ObjectCaster($typeToClassnameMap[$this->type])
		: new \Bitrix\Crm\Dto\Caster\InvalidValueCaster()
	;
}