TaskFieldHandler::prepareTags

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. TaskFieldHandler
  4. prepareTags
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/control/handler/taskfieldhandler.php
  • Класс: BitrixTasksControlHandlerTaskFieldHandler
  • Вызов: TaskFieldHandler::prepareTags
public function prepareTags(): self
{
	if (
		$this->taskId
		&& !array_key_exists('TAGS', $this->fields)
	)
	{
		return $this;
	}

	if (empty($this->fields['TAGS']))
	{
		$this->fields['TAGS'] = [];
		return $this;
	}

	if (
		!$this->taskId
		&& !isset($this->fields['TAGS'])
	)
	{
		$this->fields['TAGS'] = [];
	}

	if (is_string($this->fields['TAGS']))
	{
		$this->fields['TAGS'] = explode(',', $this->fields['TAGS']);
	}

	if (!is_array($this->fields['TAGS']))
	{
		$this->fields['TAGS'] = [$this->fields['TAGS']];
	}

	return $this;
}

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