• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/internals/model.php
  • Класс: BitrixDiskInternalsModel
  • Вызов: Model::toArray
public function toArray(array $with = []): array
{
	$data = [];
	$referenceAttributes = self::getMapReferenceAttributes();
	foreach (static::getMapAttributes() as $name => $attribute)
	{
		if (is_array($attribute))
		{
			$attribute = array_pop($attribute);
		}
		if (isset($referenceAttributes[$name]) && !in_array($name, $with, true))
		{
			continue;
		}

		$getterName = 'get' . $attribute;
		if (method_exists($this, $getterName))
		{
			$data[$name] = $this->$getterName();
		}
	}

	return $data;
}