Prestashop 1.7.7 在自定义字段上创建 ToggleColumn

Prestashop 1.7.7 create a ToggleColumn on a custom field

在我的数据库中,我有一个字段 isVerified,它是一个 bool : 0 / 1

我想创建一个 ToggleColumn,所以每当我点击管理面板时,它都会切换到 true / 1,我会执行发送邮件等操作。

这是我到目前为止所做的:

`

admin_customers_toggle_verify:
          path: /{customerId}/toggle-verify
          methods: [POST]
          defaults:
            _controller: PrestaShopBundle:Admin/Sell/Customer/Customer:toggleVerify
            _legacy_controller: AdminCustomers
            _legacy_link: AdminCustomers:verifycustomer
            _legacy_parameters:
              id_customer: customerId
          requirements:
            customerId: \d+

我找到的解决方案是在这些文件中添加字段:

- CustomerFormDataProvider
- CustomerFormDataHandler
- AddCustomerCommand
- EditCustomerCommand
- GetCustomerForEditingHandler
- EditableCustomer
- CustomerType