Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActiveRecord link() / unlink() #5

Open
Krakozaber opened this issue Apr 27, 2018 · 0 comments
Open

ActiveRecord link() / unlink() #5

Krakozaber opened this issue Apr 27, 2018 · 0 comments

Comments

@Krakozaber
Copy link

Есть 3 таблицы:
Основные:
TableA: id_a, data
TableB: id_b,data

Таблица связей (viaTable):
TableC: id_a, id_b, type

метод link() позволяет создать ссылку по типу:
$modelA->link('relAB', $modelB, ['type' => 1]);
$modelA->link('relAB', $modelB, ['type' => 2]);
что весьма удобно

Метод unlink() не может удалить ссылку с определённым type, он удаляет только всё.
Хотелось бы видеть идентичное поведение у данных методов, а именно возможность задать в unlink() дополнительные параметры.

Q A
Yii version 2.0.15.1
PHP version 7.0
Operating system Debian 9
@samdark samdark transferred this issue from yiisoft/yii2 Nov 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant