i strongly recommend this:
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/association-mapping.html
but to make the long story short here is your YAML for case1
if you want a bidirectional relation:
Client: // dont forget namespace
type: entity
table: client
id:
id:
type: integer
generator: { strategy: AUTO }
fields:
number:
type: integer
oneToMany: // each client has many services
services: // the variable to store services of client
targetEntity: Service
mappedBy: client // the variable to store client of a service
Service:
... //same as above
manyToOne:
client:
targetEntity: Client
inversedBy: services
i didnt understood the case2 properly.