/**
  * {@inheritdoc}
  */
 protected function build(Definition $definition, \Model $model, DefinitionMapper $mapper, Filter $filter = null, Definition $parent = null)
 {
     parent::build($definition, $model, $mapper, $filter);
     if ($definition instanceof Path && $model->style) {
         $styleModel = StyleModel::findActiveByPK($model->style);
         if ($styleModel) {
             $style = $mapper->handle($styleModel);
             if ($style instanceof Style) {
                 $style->apply($definition);
             }
         }
     }
     $this->buildPopup($definition, $model, $mapper, $filter);
 }
 /**
  * Get all styles.
  *
  * @return array
  */
 public function getStyles()
 {
     $collection = StyleModel::findAll(array('order' => 'title'));
     return OptionsBuilder::fromCollection($collection, 'title')->getOptions();
 }
 /**
  * Load fallback style.
  *
  * @param DefinitionMapper $mapper The definition mapper.
  *
  * @return void
  */
 protected function loadFallbackStyle(DefinitionMapper $mapper)
 {
     if ($this->model->style) {
         $styleModel = StyleModel::findActiveByPK($this->model->style);
         if ($styleModel) {
             $this->fallbackStyle = $mapper->handle($styleModel);
         }
     }
 }