Example #1
0
 /**
  * @return Shopware\Models\Config\Form
  */
 private function initForm()
 {
     $info = $this->Info();
     $formRepository = $this->Forms();
     $form  = new \Shopware\Models\Config\Form;
     $form->setPluginId($this->getId());
     $form->setName($info->name);
     $form->setLabel($info->label);
     $form->setDescription($info->description);
     $parent = $formRepository->findOneBy(array(
         'name' => strpos($this->name, 'Payment') !== false ? 'Payment' : 'Other'
     ));
     $form->setParent($parent);
     $this->Application()->Models()->persist($form);
     return $form;
 }