I am trying to create a querybuilder using ORM. But I stumble upon a field on an entity with a relationship to 2 possible tables. With this structure it would be (IMHO) impossible to map it in the entity itself.
╔═══════╗ ╔═══════╗ ╔═══════╗
║ ValB ║ ║ Main ║ ║ ValC ║
╠══╦════╣ ╠══╦════╣ ╠══╦════╣
║ *║ pk ║-- + ║ *║ pk ║ +---║ *║ pk ║
╠══╬════╣ | ╠══╬════╣ | ╠══╬════╣
║ ║ ║ +--║ ║v_id║---+ ║ ║ ║
╠══╬════╣ ╠══╬════╣ ╠══╬════╣
║ ║ ║ ║ ║ ║ ║ ║ ║
╚══╩════╝ ╚══╩════╝ ╚══╩════╝
Is is possible to mix DBAL QueryBuilder with ORM QueryBuilder, or any other way that will still use the ORM QueryBuilder mostly on the code.
PS. I did not design the db and im just optimizing it. sorry for this :(