Does hasManyToMany relation need an alias?

I'm trying to setup a hasManyToMany relation with Phalcon models. It only seems to work when I setup an alias for the relation. If I don't set one, I can't manage to make it work! Is setting an alias mandatory for a hasManyToMany relation between models?

Its possible, cuz you need in phalcon intermediate model, you dont really select field from current model where records should be mapped, you set it in alias.



46.8k

Its only necessary if you want to use that alias for saving or querying the related models. It would still cascade on delete and that sort of thing. So a whole lot of functionality disappears if it doesn't have an alias.