In my DB I have two relation between two tables :
A “many to one” and a “many to many”

So when I load the object CEO i have that :
[ceo] => Object
(
[id] => 1
[Current_Company] => Object
(
[id] => 1
[ceo] => Object
*RECURSION*
)
)
There is no error, doctrine and symfony work well. But is it a good way to keep that recursion in the schema ?
I think this question is more general than Doctrine and Symfony, so I’ll give a high level answer, sharing my philosophy.
There are two camps of thinking:
I belong to the first camp. For me, a database usually outlives the applications using it, so it’s logical to bend applications to a database — not vice versa. That means that, if the database and the application layer have a conflict, the database layer wins. That’s why I favor the DataMapper pattern over ActiveRecord: AR makes you change you database schema to match your application, while DM makes your application fit the database schema.
It’s perfectly fine to have bidirectional relationships in the database schema, so whatever database abstraction tool I’m using, it has to accept that and live with that.