Skip to content

Ability to replace primaryKey field via config#706

Open
asgraf wants to merge 1 commit intoFriendsOfCake:masterfrom
asgraf:patch-3
Open

Ability to replace primaryKey field via config#706
asgraf wants to merge 1 commit intoFriendsOfCake:masterfrom
asgraf:patch-3

Conversation

@asgraf
Copy link
Copy Markdown

@asgraf asgraf commented Oct 24, 2023

Example use case:

$this->Crud->action()->setConfig('primaryKey', 'uuid');

this change makes FriendsOfCake/crud plugin compatible with dereuromark/cakephp-expose

Example:
$this->Crud->action()->setConfig('primaryKey', 'uuid');
@codecov
Copy link
Copy Markdown

codecov bot commented Oct 24, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f437194) 90.45% compared to head (90dfe38) 90.46%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #706   +/-   ##
=========================================
  Coverage     90.45%   90.46%           
  Complexity      369      369           
=========================================
  Files            36       36           
  Lines          1153     1154    +1     
=========================================
+ Hits           1043     1044    +1     
  Misses          110      110           
Files Coverage Δ
src/Traits/FindMethodTrait.php 80.55% <100.00%> (+0.55%) ⬆️

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

@ADmad
Copy link
Copy Markdown
Member

ADmad commented Oct 25, 2023

  • Test(s) required for the change.
  • The primaryKey config should be added to $_defaultConfig of all actions that use the FindMethodTrait::_findRecord() method.
  • Docs need to be updated to provide info about this new option.

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.

2 participants