custom/plugins/CrayssnLabsOpenAIContentCreator/src/CrayssnLabsOpenAIContentCreator.php line 19

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace CrayssnLabsOpenAIContentCreator;
  3. use Shopware\Core\Framework\Plugin;
  4. use Shopware\Core\Framework\Plugin\Context\InstallContext;
  5. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  6. use CrayssnLabsOpenAIContentCreator\Framework\Lifecycle;
  7. use Shopware\Core\Framework\Plugin\Context\UpdateContext;
  8. /**
  9. * Class CrayssnLabsOpenAIContentCreator
  10. *
  11. * @package CrayssnLabsOpenAIContentCreator
  12. *
  13. * @author Sebastian Ludwig <dev@cl.team>
  14. * @copyright Copyright (c) 2023, CrayssnLabs Ludwig Wiegler GbR
  15. */
  16. class CrayssnLabsOpenAIContentCreator extends Plugin
  17. {
  18. const CUSTOM_FIELD_SET_NAME = 'CrayssnLabsOpenAIContentCreator_editor_configuration';
  19. const CUSTOM_FIELD_TOPIC = 'CrayssnLabsOpenAIContentCreator_editor_configuration_topic';
  20. const CUSTOM_FIELD_KEYWORDS = 'CrayssnLabsOpenAIContentCreator_editor_configuration_keywords';
  21. const CUSTOM_FIELD_WORD_COUNT = 'CrayssnLabsOpenAIContentCreator_editor_configuration_word_count';
  22. const CUSTOM_FIELD_HEADLINE1_TAG = 'CrayssnLabsOpenAIContentCreator_editor_configuration_headline1_tag';
  23. const CUSTOM_FIELD_HEADLINE2_TAG = 'CrayssnLabsOpenAIContentCreator_editor_configuration_headline2_tag';
  24. const CUSTOM_FIELD_KEYWORD_TAG = 'CrayssnLabsOpenAIContentCreator_editor_configuration_keyword_tag';
  25. const CONFIG_PROMPT_PATTERN_SEO_TITLE = 'CrayssnLabsOpenAIContentCreator.config.promptPatternSeoTitle';
  26. const CONFIG_PROMPT_PATTERN_SEO_DESCRIPTION = 'CrayssnLabsOpenAIContentCreator.config.promptPatternSeoDescription';
  27. /**
  28. * Function install
  29. *
  30. * @param \Shopware\Core\Framework\Plugin\Context\InstallContext $installContext
  31. */
  32. public function install(InstallContext $installContext): void
  33. {
  34. (new Lifecycle\Install($this->container, $installContext->getContext()))->run();
  35. parent::install($installContext);
  36. }
  37. /**
  38. * Function uninstall
  39. *
  40. * @param \Shopware\Core\Framework\Plugin\Context\UninstallContext $uninstallContext
  41. */
  42. public function uninstall(UninstallContext $uninstallContext): void
  43. {
  44. (new Lifecycle\Uninstall($this->container, $uninstallContext->getContext()))->run();
  45. parent::uninstall($uninstallContext);
  46. }
  47. /**
  48. * Function update
  49. *
  50. * @param \Shopware\Core\Framework\Plugin\Context\UpdateContext $updateContext
  51. */
  52. public function update(UpdateContext $updateContext): void
  53. {
  54. (new Lifecycle\Update($this->container, $updateContext->getContext()))->run();
  55. parent::update($updateContext);
  56. }
  57. }