active-record
active-record copied to clipboard
Implement `ActiveRelation::class`.
| Q | A |
|---|---|
| Is bugfix? | ❌ |
| New feature? | ✔️ |
| Breaks BC? | ❌ |
PR Summary
-
Added ActiveArrayHelper class Introduces a new class for better handling of arrays
-
Added ActiveRelation class Replaces the $related array in BaseActiveRecord and BaseActiveRecordTrait classes for enhanced functionality
-
Improved populateRelation method Now uses a set instead of adding a new element, addressing an issue with composite primary keys: #8
-
Changed related records storage Related records are now stored as objects instead of arrays, allowing for easier manipulation with methods like add(), remove(), etc. Achieved without breaking backward compatibility.
Codecov Report
Patch coverage: 95.31% and project coverage change: +0.25 :tada:
Comparison is base (
0ebe2c7) 87.73% compared to head (43ed758) 87.99%.
Additional details and impacted files
@@ Coverage Diff @@
## master #264 +/- ##
============================================
+ Coverage 87.73% 87.99% +0.25%
- Complexity 597 612 +15
============================================
Files 7 9 +2
Lines 1329 1366 +37
============================================
+ Hits 1166 1202 +36
- Misses 163 164 +1
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/BaseActiveRecord.php | 84.86% <90.00%> (-0.08%) |
:arrow_down: |
| src/ActiveArrayHelper.php | 94.73% <94.73%> (ø) |
|
| src/ActiveRelation.php | 100.00% <100.00%> (ø) |
|
| src/BaseActiveRecordTrait.php | 94.44% <100.00%> (+0.12%) |
:arrow_up: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.