Impact::__construct

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. Impact
  4. __construct
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/processor/task/result/impact.php
  • Класс: BitrixTasksProcessorTaskResultImpact
  • Вызов: Impact::__construct
public function __construct($data, $userId = 0)
{
	$this->setUserId($userId);

	$baseMixin = static::getBaseMixin();

	$allowed = array_merge(array(
		'ID',
	), $baseMixin['select']);

	if(is_array($data))
	{
		$data = array_intersect_key($data, array_flip($allowed));
	}
	elseif(is_numeric($data))
	{
		$data = intval($data);
		if($data)
		{
			$data = TaskTable::getList(array(
				'filter' => array('=ID' => $data),
				'select' => $allowed,
			))->fetch();
			if(!$data)
			{
				$data = array();
			}
		}
		else
		{
			$data = array();
		}
	}

	$this->data = $data;
}

Добавить комментарий