/**
  * Handle the command.
  *
  * @param EntryFormBuilder $builder
  */
 public function handle(EntryFormBuilder $builder)
 {
     $type = $this->partial->getType();
     $builder->setModel($type->getEntryModelName());
     $builder->setEntry($this->partial->getEntryId());
     $this->builder->addForm('entry', $builder);
 }
 /**
  * Fired after the entry form is saved.
  *
  * After the entry form is saved take the
  * entry and use it to populate the partial
  * before it saves directly after.
  *
  * @param EntryFormBuilder $builder
  */
 public function onSavedEntry(EntryFormBuilder $builder)
 {
     /* @var FormBuilder $form */
     $form = $this->forms->get('partial');
     $partial = $form->getFormEntry();
     $entry = $builder->getFormEntry();
     $partial->entry_id = $entry->getId();
     $partial->entry_type = get_class($entry);
 }
 /**
  * Handle the command.
  *
  * @param TypeRepositoryInterface $types
  * @param EntryFormBuilder        $builder
  * @param Request                 $request
  */
 public function handle(TypeRepositoryInterface $types, EntryFormBuilder $builder, Request $request)
 {
     $type = $types->find($request->get('type'));
     $this->builder->addForm('entry', $builder->setModel($type->getEntryModelName()));
 }