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

Delete link in many to many relationship

How I can delete link in the many to many relationship? This is my relation:

$this->hasManyToMany(
 "id", "LabelsHasPersons", "persons_id", "labels_id", "Labels", "id", array('alias' => 'Labels')
);

Persons has some labels with ID e.g 1,2,3 I would like delete link between person and label: 2

Hi @TrueShutDown you have to declare a toMany relation with LabelsHasPersons

$this->hasMany("id", "LabelsHasPersons", "persons_id", ['alias' => 'labels_x_persons']);

Then simply delete your LabelsHasPersons

Good luck