コード例 #1
0
 /**
  * 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();
 }
コード例 #2
0
 /**
  * Handle the command.
  *
  * @param ValueTreeBuilder $builder
  */
 public function handle(ValueTreeBuilder $builder)
 {
     $stream = $builder->getTreeStream();
     $column = $stream->getTitleColumn();
     if ($column == 'id') {
         return;
     }
     $builder->setSegments([$column]);
 }
コード例 #3
0
 /**
  * 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;
 }
コード例 #4
0
 /**
  * Handle the command.
  *
  * @param ValueTreeBuilder $builder
  */
 public function handle(ValueTreeBuilder $builder)
 {
     $builder->setButtons(['remove' => ['data-dismiss' => 'relationship']]);
 }