3

Does anyone know how to override Doctrine_Record getters and setters for Relation fields. For example if I have a class Note, Note has many Users, now can I override, for example, this operation Note->Users[] = $user1 ?

Thanks!

spacemonkey
  • 19,664
  • 14
  • 42
  • 62

1 Answers1

2

Never tried it myself but you should be able to do this with _get and _set. There is also a post here on SO that asks almost the same thing:

Overriding Doctrine_Record (sfDoctrineRecord) instance methods in Doctrine PHP Symfony

Community
  • 1
  • 1
DrColossos
  • 12,656
  • 3
  • 46
  • 67
  • I have already tried doing it in this way, but all I get is just an error. I am able to set basic fields, but not the ones which have relation with other tables. – spacemonkey Jul 29 '10 at 17:52