custom/plugins/MyKeje/src/OkeonlineMyKeje.php line 12

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Okeonline\MyKeje;
  3. use Shopware\Core\Framework\Plugin;
  4. use Shopware\Core\Framework\Uuid\Uuid;
  5. use Shopware\Core\System\CustomField\CustomFieldTypes;
  6. use Shopware\Core\Framework\Plugin\Context\InstallContext;
  7. use Shopware\Core\System\CustomField\Aggregate\CustomFieldSet\CustomFieldSetEntity;
  8. use Shopware\Core\System\CustomField\Aggregate\CustomFieldSetRelation\CustomFieldSetRelationEntity;
  9. class OkeonlineMyKeje extends Plugin
  10. {
  11.     public function install(InstallContext $installContext): void
  12.     {
  13.         
  14.         $customFieldSetRepository $this->container->get('custom_field_set.repository');
  15.         $customFieldSetRepository->upsert([
  16.             [
  17.                 'id' => 'a035a6ea0446415295d83b73ff222f06',
  18.                 'name' => 'oo_order',
  19.                 'config' => [
  20.                     'label' => [
  21.                         'en-GB' => 'Order customFields',
  22.                         'de-DE' => 'Order customFields',
  23.                         'nl-NL' => 'Order customFields'
  24.                     ]
  25.                 ],
  26.                 'relations' => [
  27.                     [
  28.                         'id' => '162950ded05d4e77a74b83ba2088b385',
  29.                         'entityName' => 'order'
  30.                     ]
  31.                 ],
  32.                 'customFields' => [
  33.                     [
  34.                         'id' => '162950ded05d4e77a74b83ba2088b384',
  35.                         'name' => 'oo_order_origin',
  36.                         'type' => CustomFieldTypes::TEXT,
  37.                         'config' => [
  38.                             'label' => [
  39.                                 'en-GB' => 'Where does this order originate from?',
  40.                                 'de-DE' => 'Woher stammt diese Bestellung?',
  41.                                 'nl-NL' => 'Waar is deze order geplaatst?'
  42.                             ],
  43.                             'customFieldPosition' => 1
  44.                         ]
  45.                     ]
  46.                 ]
  47.             ]
  48.         ], $installContext->getContext());
  49.     }
  50. }