What about overriding the init() method? Maybe a dumb question, did you try overriding the primaryKey() method in your AR class?
BTW, regarding "static method calls", did you mean calls like City::model()->someMethod() ? I just figured out by reading the source that, while model() is a static method, it returns a shared class instance, which is created on demand.
Sometimes it’s that easy! I don’t know why but i’ve never seen the primaryKey method only the primaryKey property.
That’s exactly what i was looking for.
Thank you, tri!
Further on:
yes, i ment s.th. like City::model()->someMethod(). I didn’t dig into the instance generation. I’ve just overridden the init() method and set a trace which showed me that it’s not called when using such a method call.