• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/internals/entity/model.php
  • Класс: BitrixDiskInternalsEntityModel
  • Вызов: Model::__call
public function __call($name, $arguments)
{
	if (mb_substr($name, 0, 3) !== 'get')
	{
		return null;
	}

	$possibleReference = lcfirst(mb_substr($name, 3));

	if (isset($this->lazyAttributes[$possibleReference]) || $this->isLoadedAttribute($possibleReference))
	{
		return $this->lazyAttributes[$possibleReference];
	}

	$mapReferenceAttributes = FieldManager::getInstance()->getReferenceFieldsByModel($this);
	if (!isset($mapReferenceAttributes[$possibleReference]))
	{
		return null;
	}

	if (!isset($mapReferenceAttributes[$possibleReference]['load']))
	{
		return null;
	}

	$load = $mapReferenceAttributes[$possibleReference]['load'];
	$this->lazyAttributes[$possibleReference] = $load($this);

	return $this->lazyAttributes[$possibleReference];
}