php - Symfony 3: Can't make relations work -
i have entity(s) , entityhtml(s) entities has one-to-one relashionship (entity stores metadata , entityhtml acts cache, storing ready html chunks rendering).
i have defined relationship in entity class:
/** * @orm\onetoone(targetentity="entityhtml") * @orm\joincolumn(name="entityid", referencedcolumnname="entityid") */ private $entityhtml;
but isn't working. have kind of feeling, annotations don't work @ all, because changing them has no effect upon workability of application.
on other hand, messing .orm.xml(s) reflects in how application works.
- can tell symfony update orm xmls based on changes annotations?
- should duplicate relation meta xml?
- does symfony use info @ both xml , annotations or choose 1 source?
config.yml default one:
# doctrine configuration doctrine: dbal: driver: pdo_mysql host: "%database_host%" port: "%database_port%" dbname: "%database_name%" user: "%database_user%" password: "%database_password%" charset: utf8 # if using pdo_sqlite database driver: # 1. add path in parameters.yml # e.g. database_path: "%kernel.root_dir%/data/data.db3" # 2. uncomment database_path in parameters.yml.dist # 3. uncomment next line: # path: "%database_path%" orm: auto_generate_proxy_classes: "%kernel.debug%" naming_strategy: doctrine.orm.naming_strategy.underscore auto_mapping: true
does make difference if try this:
/** * @orm\onetoone(targetentity="entityhtml") * @orm\joincolumn(name="entity_id", referencedcolumnname="entityid") */
i'm thinking "entityid" id in entityhtml, , need specify different "name" value in joincolumn. think ran problem.
try - i'm not sure if work.
Comments
Post a Comment