• Модуль: conversion
  • Путь к файлу: ~/bitrix/modules/conversion/lib/internals/basecontext.php
  • Класс: BitrixConversionInternalsBaseContext
  • Вызов: BaseContext::setAttribute
public function setAttribute($name, $value = null)
{
	if (! is_string($name))
		throw new ArgumentTypeException('name', 'string');

	if (! (is_scalar($value) || is_null($value)))
		throw new ArgumentTypeException('name', 'scalar');

	if ($this->id !== null)
		throw new SystemException('Cannot set attribute for existent context!');

	static $types;
	if (! $types)
	{
		$types = AttributeManager::getTypes();
	}

	if (! $type = $types[$name])
		throw new SystemException("Undefined attribute '$name' type!");

	// set attribute

	$this->attributes[$name] = $value;
}