I have read many questions about this problem and I am almost 100% sure, there is an error in the configuration, but I can't find it on the second day. Can somebody please help me?
My configuration:
orm:
auto_generate_proxy_classes: true
naming_strategy:
doctrine.orm.naming_strategy.underscore_number_aware
auto_mapping: true
mappings:
Post:
is_bundle: false
type: attribute
dir:'%kernel.project_dir%/src/Core/Post/Domain/Entity'
prefix: 'Core/Post/Domain/Entity'
alias: Post
My entity:
#[Entity(repositoryClass: PostRepository::class)] class Post { use IdentifierTrait;
public const HEADER = 'header';
public const BOD = 'body';
public const AUTHOR = 'author';
#[Column(Types::STRING, length: 140)]
private string $header;
#[Column(Types::STRING)]
private string $body;
#[Column(Types::STRING)]
private string $author;
}
CodePudding user response:
Problem was using forslashes instead of backslashes in doctrine.yaml in prefix property. Hope it will help somebody.