【发布时间】:2022-08-03 16:49:18
【问题描述】:
我在装饰最终类 \"DocumentGenerator\"(在 vendor/shopware/core/Checkout/Document/Service/DocumentGenerator.php 中)并覆盖其中的 \"generate\" 函数时遇到问题。 我试图用通常的方式装饰它,但是由于\“DocumentController\”类除了原始类而不是我装饰的类而引发错误吗?
传递给 Shopware\\Core\\Checkout\\Document\\DocumentGeneratorController::__construct() 的参数 2 必须是 Shopware\\Core\\Checkout\\Document\\Service\\DocumentGenerator 的实例
它也无法从我的装饰类中扩展,因为 \"DocumentGenerator\" 是最终类。
我的目标是在生成订单文档后执行附加代码。以前我成功地用来装饰 \"DocumentService\" 类,但它被标记为已弃用,不应再使用。 \"DocumentGenerator\" 类也用于新的 \"bulkedit\" 函数,用于从版本 6.4.14.0 开始的文档
我很感激每一个提示。