yiisoft / yiisoft/active-record
Link multiple models at a time
Open
Nobody has claimed this yet.
status:ready for adoption
type:feature
- Dominant language
- PHP
- Stars
- 119
- Forks
- 38
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 1
Description
Proposed new feature or change
// Currently
foreach ($categories as $category) {
$post->link('categories', $category);
}
// That I want
$post->link('categories', $categories);
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the model relationship entry point for the existing link('categories', $category) call and any tests covering it. Determine how a collection of models should be handled, then add coverage showing that passing $categories links every model and that the existing single-model behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100