/** * Handle the command. * * @param EntryFormBuilder $builder */ public function handle(EntryFormBuilder $builder) { $type = $this->page->getType(); $builder->setModel($type->getEntryModelName()); $builder->setEntry($this->page->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 page * before it saves directly after. * * @param EntryFormBuilder $builder */ public function onSavedEntry(EntryFormBuilder $builder) { /* @var FormBuilder $form */ $form = $this->forms->get('page'); $page = $form->getFormEntry(); $entry = $builder->getFormEntry(); $page->entry_id = $entry->getId(); $page->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())); }