symfony - 构建缓存后不考虑 Symfony Doctrine 配置自定义类型
问题描述
你好,我在 Symfony4(4.0.9)上的 Doctrine 有一个奇怪的行为,在控制台中,缓存是由第一次运行某些命令(在开发环境中)生成的,在 config/packages/doctrine.yml 中定义的自定义类型不再考虑。为什么会发生这种情况,我该如何解决?
其他可能有用的信息:我从 Symfony2 应用程序复制了应用程序代码(控制器、实体等),并将其导入到新的 Symfony 4 应用程序中,因为我正在使其与 Symfony 4 兼容。另外,我在应用程序的网络版本上没有这种行为(始终识别自定义类型)
# config/packages/doctrine.yml
doctrine:
dbal:
# configure these for your database server
driver: 'pdo_mysql'
server_version: '5.7'
charset: utf8mb4
default_table_options:
charset: utf8mb4
collate: utf8mb4_unicode_ci
url: '%env(resolve:DATABASE_URL)%'
types:
enumprofilecompletionstep: 'App\DBAL\EnumProfileCompletionStepPossibleValuesType'
enumsection: 'App\DBAL\EnumSectionType'
enumsex: 'App\DBAL\EnumSexType'
enumstatus: 'App\DBAL\EnumStatusType'
phone_number: 'Misd\PhoneNumberBundle\Doctrine\DBAL\Types\PhoneNumberType'
orm:
auto_generate_proxy_classes: '%kernel.debug%'
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true
mappings:
App:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App
谢谢你的时间,先生POC
解决方案
推荐阅读
- c# - 从控制器中删除配置中设置的属性
- authentication - 在浏览器上验证 JWT
- wordpress - 在页面 GTM 中找到代码时的自定义触发器
- uwp - GridView 设置固定列号
- android - android无法设置值以在webview中输入标签
- push-notification - Appcelerator 的推送通知 API
- c# - 读取二维数组并输出为表 C#
- ember.js - Ember js 过滤模型中的数据
- prolog - 如何停止回溯并结束 Prolog 中的递归
- javascript - 图像加载后Jquery Lazy Loading,未应用css