• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/filter/field.php
  • Класс: BitrixMainFilterField
  • Вызов: Field::toArray
public function toArray(array $options = null)
{
	if(!is_array($options))
	{
		$options = [];
	}

	$result = [ 'id' => $this->id, 'name' => $this->name ];
	if($this->type !== '')
	{
		$result['type'] = $this->type;
	}

	if($this->isDefault)
	{
		$result['default'] = true;
	}

	if ($this->sectionId !== '')
	{
		$result['sectionId'] = $this->sectionId;
	}
	if (!empty($this->iconParams))
	{
		$result['icon'] = $this->iconParams;
	}

	if(isset($options['lightweight']) && $options['lightweight'])
	{
		$result['lightweight'] = true;
		return $result;
	}

	if($this->isPartial())
	{
		$this->assemble();
	}

	if(is_array($this->data))
	{
		foreach($this->data as $key => $data)
		{
			$result[$key] = $data;
		}
	}

	return $result;
}