Skip to content

Conversation

@dereuromark
Copy link
Owner

Demonstrates the new projectAs() ORM feature:

  • BelongsTo association (Users -> Roles)
  • HasMany association with #[CollectionOf] (Roles -> Users)
  • BelongsToMany with _joinData (Posts -> Tags)
  • matching() queries with _matchingData
  • Performance benchmark comparing Entity vs DTO approaches

Includes both DtoMapper style (reflection-based) and cakephp-dto plugin style (createFromArray) examples.

Demonstrates the new projectAs() ORM feature:
- BelongsTo association (Users -> Roles)
- HasMany association with #[CollectionOf] (Roles -> Users)
- BelongsToMany with _joinData (Posts -> Tags)
- matching() queries with _matchingData
- Performance benchmark comparing Entity vs DTO approaches

Includes both DtoMapper style (reflection-based) and
cakephp-dto plugin style (createFromArray) examples.
@codecov-commenter
Copy link

codecov-commenter commented Dec 17, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 705 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.53%. Comparing base (e6f13fe) to head (f2608bd).

Files with missing lines Patch % Lines
src/Dto/ArticleBenchmarkDto.php 0.00% 124 Missing ⚠️
src/Controller/DtoProjectionController.php 0.00% 120 Missing ⚠️
src/Dto/UserProjectionDto.php 0.00% 120 Missing ⚠️
src/Dto/CommentBenchmarkDto.php 0.00% 93 Missing ⚠️
src/Dto/RoleProjectionDto.php 0.00% 79 Missing ⚠️
src/Dto/UserSimpleProjectionDto.php 0.00% 72 Missing ⚠️
src/Dto/AuthorBenchmarkDto.php 0.00% 51 Missing ⚠️
src/Controller/MiscController.php 0.00% 38 Missing ⚠️
src/Dto/MatchingDataDto.php 0.00% 1 Missing ⚠️
src/Dto/PostDto.php 0.00% 1 Missing ⚠️
... and 6 more
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #102      +/-   ##
============================================
- Coverage     64.61%   56.53%   -8.08%     
- Complexity     1252     1463     +211     
============================================
  Files           115      130      +15     
  Lines          4934     5639     +705     
============================================
  Hits           3188     3188              
- Misses         1746     2451     +705     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Shows that _matchingData CAN be included in DTOs by explicitly
adding it as a constructor parameter. Compares:
- SimpleUserDto (without _matchingData) - data is ignored
- UserWithMatchingDto (with _matchingData) - data is included
Shows that _matchingData can be either:
- ?array - simple, data stays as arrays
- ?MatchingDataDto - full type safety with nested DTOs

Property names in MatchingDataDto must match association aliases.
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

Successfully merging this pull request may close these issues.

3 participants