- Модуль: seo
- Путь к файлу: ~/bitrix/modules/seo/lib/businesssuite/configuration/facebook/config.php
- Класс: BitrixSeoBusinessSuiteConfigurationFacebookConfig
- Вызов: Config::toArray
public function toArray(): array
{
$result = array_reduce(
static::getFieldCodes(),
(function (array $result, string $code) : array
{
$field = $this::getField($code);
if($field::available())
{
if ($value = $this->get($code))
{
$result[$code] = $value;
}
elseif ($field::required())
{
throw new ExceptionRequiredFieldNotFoundException("$code");
}
}
return $result;
})->bindTo($this,$this),
array()
);
$keys = array_keys($result);
foreach ($this::FIELDS_DEPENDENCIES as $code => $dependencies)
{
if($result[$code] && count($undefined = array_diff($dependencies,$keys)) > 0)
{
throw new ExceptionUnresolvedDependencyException("$code:".implode(',',$undefined));
}
}
return $result;
}