protected function fillConfigByDbResult(Config &$config, $dbResult) { $configType = $this->typeRepository->getConfigType($config->getPageTypeId()); foreach ($dbResult as $row) { $varname = $row->varname; try { $type = $configType->get($varname); $fieldName = $this->getColumnOfXType($type); $value = $this->castFromDatabase($type, $row->{$fieldName}); $config->setFromModel($varname, $value); } catch (OutOfBoundsException $e) { continue; } } return $config; }
public function getIcon() { $configPath = 'pagetype-categories.' . $this->getName() . '.icon'; return LaravelConfig::get($configPath); }