/** * Return the selected entries. * * @param ValueTreeBuilder $tree * @param $key * @return null|string */ public function selected(ValueTreeBuilder $tree, $key) { /* @var Collection $config */ $config = $this->dispatch(new GetConfiguration($key)); $tree->setConfig($config)->setModel($config->get('related'))->setSelected($this->request->get('uploaded')); $this->dispatch(new HydrateValueTree($tree)); return $tree->build()->response()->getTreeContent(); }
/** * Handle the command. * * @param ValueTreeBuilder $builder */ public function handle(ValueTreeBuilder $builder) { $stream = $builder->getTreeStream(); $column = $stream->getTitleColumn(); if ($column == 'id') { return; } $builder->setSegments([$column]); }
/** * Handle the command. * * @param RelationshipFieldType $fieldType * @param AddonCollection $addons * @param Repository $config * @return array */ public function handle(RelationshipFieldType $fieldType, AddonCollection $addons, Repository $config) { $definition = []; /* @var Addon $addon */ foreach ($addons->withConfig('value.' . $this->tree->config('related')) as $addon) { $definition = $config->get($addon->getNamespace('value.' . $this->tree->config('related'))); } $definition = $config->get($fieldType->getNamespace('value.' . $this->tree->config('related')), $definition); return $definition; }
/** * Handle the command. * * @param ValueTreeBuilder $builder */ public function handle(ValueTreeBuilder $builder) { $builder->setButtons(['remove' => ['data-dismiss' => 'relationship']]); }