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

Updating related records

I'm trying to implement an update to related records. I've read the documentation regarding this feature (available here: https://docs.phalcon.io/en/latest/reference/models.html#updating-related-records)

I'm using Phalcon 1.2.3 and I get the following error when calling the update method:

Call to undefined method Phalcon\Mvc\Model\Resultset\Simple::update()

My (simplified) code is:

public function afterSave() {
    $this->getRelatedRecords()->update(array('column' => 'value');
}

Shouldn't this method be available on Phalcon 1.2.3?

Thank you.



98.9k
Accepted
answer

That method was removed due to a problem, it seems we need to remove it from the docs too :)

It still in the docs. There's any other any to updated related records?



8.6k

Is there a way to get related records for a resultset(not single row)?



8.1k

To update related records: I guess they way as is given in the example in the docs? (the 'Instead of...' bit)