We are using Phalcon to handle our API and a sa result we often like to return back portions of related records. One thing I'm finding that might be bad design on my end is when I'm working with an object to return and I have to do a quick update on it - it's cascading that update to related records, which I don't want to happen..
Simple example: $customer = new \Models\FindFirst($id); $customer->referred_by; // touch it to return it $customer->last_login = time(); $customer->update(); return $customer;
Above code will try to do an update on the referred by object too. This is causing some serious issues in some palces of our code. There must be a way to programmatically turn this off. How can I do that?