gpt4 book ai didi

symfony - Doctrine.yaml”不包含有效的YAML : A colon cannot be used in an unquoted mapping value

转载 作者:行者123 更新时间:2023-12-05 05:59:20 25 4
gpt4 key购买 nike

我看到有人问过类似的问题,但没有找到我的答案。大多数都是某种类型的拼写错误,这对我来说可能是真的,但我已经盯着这个看了一个小时了,但找不到一个,也许其他人能找到我真的很感激!

  doctrine:
dbal:
default_connection: default
connections:
default:
#User DB
url: '%env(resolve:DATABASE_URL)%'
driver: 'pdo_mysql'
server_version: '5.7'
charset: utf8mb4
mededelingen:
#mededelingen DB
url: '%env(resolve:DATABASE_MEDEDELINGEN_URL)%'
driver: 'pdo_mysql'
server_version: '5.7'
charset: utf8mb4
# IMPORTANT: You MUST configure your server version,
# either here or in the DATABASE_URL env var (see .env file)
#server_version: '13'
orm:
auto_generate_proxy_classes: true
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true
default:
connection: default
mappings:
users:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity\User'
alias: App
mededelingen:
connection: mededelingen
mappings:
Mededelingen:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity\Mededeling'
alias: Mededeling

第 41 行(靠近“别名:Mededeling”)

最佳答案

我尝试使用我的 linter 解决您的问题。

首先,您在 orm 之后错过了属性 entity_managers,然后我不得不移动 naming_strategyauto_mapping

auto_mapping 只能在一个实体管理器上使用,所以我将其设置为默认值。

对我来说没有问题的结果:

doctrine:
dbal:
default_connection: default
connections:
default:
#User DB
url: '%env(resolve:DATABASE_URL)%'
driver: 'pdo_mysql'
server_version: '5.7'
charset: utf8mb4
mededelingen:
#mededelingen DB
url: '%env(resolve:DATABASE_MEDEDELINGEN_URL)%'
driver: 'pdo_mysql'
server_version: '5.7'
charset: utf8mb4
# IMPORTANT: You MUST configure your server version,
# either here or in the DATABASE_URL env var (see .env file)
#server_version: '13'
orm:
entity_managers:
auto_generate_proxy_classes: true
default:
connection: default
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true
mappings:
users:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity\User'
alias: App
mededelingen:
connection: mededelingen
naming_strategy: doctrine.orm.naming_strategy.underscore
mappings:
Mededelingen:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity\Mededeling'
alias: Mededeling

关于symfony - Doctrine.yaml”不包含有效的YAML : A colon cannot be used in an unquoted mapping value,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68210010/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com