tags:

views:

114

answers:

1

Hi, Does anyone know if it is possible to specify an interface for a Doctrine model to implement within YAML?

I cannot find anything within the documentation.

Thanks

A: 

I don't believe there is a way to do that. However, you can implement an interface in you model by extending the doctrine-generated model, and implementing the interface in the subclass. In my opinion, no value is lost by having to do this extra step, because once you declare you are implementing an interface, you have to actually enter the code to do so.

You are better off implementing the interface in a subclass of the generated class, so that if you re-generate the class, none of your changes are lost.

Thomas Albright