• Модуль: seo
  • Путь к файлу: ~/bitrix/modules/seo/lib/conversion/facebook/event.php
  • Класс: BitrixSeoConversionFacebookEvent
  • Вызов: Event::__construct
public function __construct(?array $params = null)
{
	if ($params && !empty($params))
	{
		if (array_key_exists('action_source',$params) && is_string($params['action_source']))
		{
			$this->setActionSource($params['action_source']);
		}
		if (array_key_exists('event_time',$params) && is_int($params['event_time']))
		{
			$this->setTime($params['event_time']);
		}
		if (array_key_exists('opt_out',$params) && is_bool($params['opt_out']))
		{
			$this->setDynamicAdsOption($params['opt_out']);
		}
		if (array_key_exists('event_name',$params) && is_string($params['event_name']))
		{
			$this->setEventType($params['event_name']);
		}
		if (array_key_exists('event_source_url',$params) && is_string($params['event_source_url']))
		{
			$this->setSource($params['event_source_url']);
		}
		if (array_key_exists('user_data',$params))
		{
			if ($params['user_data'] instanceof UserData)
			{
				$this->setUserData($params['user_data']);

			} elseif (is_array($params['user_data']))
			{
				$this->setUserData(new UserData($params['user_data']));
			}
		}
		if (array_key_exists('custom_data',$params))
		{
			if ($params['custom_data'] instanceof CustomData)
			{
				$this->setCustomData($params['custom_data']);

			} elseif (is_array($params['custom_data']))
			{
				$this->setCustomData(new CustomData($params['custom_data']));
			}
		}
	}

	if (!$this->getParameter('event_time'))
	{
		$this->setParameter('event_time',time());
	}

}