views:

62

answers:

1

Hi,

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!

A: 

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:

http://stackoverflow.com/questions/2587115/overriding-doctrine-record-sfdoctrinerecord-instance-methods-in-doctrine-php-sy

DrColossos
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