Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 public function getIcon()
 {
     $configPath = 'pagetype-categories.' . $this->getName() . '.icon';
     return LaravelConfig::get($configPath);
 }