• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Dto/Dto.php
  • Класс: Bitrix\Crm\Dto\Dto
  • Вызов: Dto::initProperties
protected function initProperties(array $fields)
{
	foreach ($this->getProperties() as $property)
	{
		$name = $property->getName();
		if (array_key_exists($name, $fields))
		{
			$property->setValue($fields[$name]);

			$propertyValue = $this->$name;
			if ($propertyValue instanceof Dto)
			{
				$this->validationErrors->add($propertyValue->getValidationErrors()->toArray());
			}
			if (is_array($propertyValue))
			{
				foreach ($propertyValue as $propertyValueArrayItem)
				{
					if ($propertyValueArrayItem instanceof Dto)
					{
						$this->validationErrors->add($propertyValueArrayItem->getValidationErrors()->toArray());
					}
				}
			}
		}
	}
}