We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Save object WITHOUT saving relations

Hello,

I have an object1 with a "belongs to" relation to the object2. I'm looking for a way to save object1, without saving object2.

Any idea ?

Thanks

It seems that it is because we access to the relation directly as $object2->relationTo1 instead of $object2->getRelationTo1()

Any idea on how to change this ?



39.4k
Accepted
answer

Can you offer an example?

As far as I can tell if I save an object it saves just that. If I update its relationships then those will be saved too.