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

Did patch example #2

merged 3 commits into from Jan 4, 2019


None yet
2 participants
Copy link

Fivell commented Jan 3, 2019

No description provided.

@Fivell Fivell requested a review from gigorok Jan 3, 2019

if (is_array($whitelist) && isset($attributes['attributes'])) {
// keep only whitelisted attributes
$attributes['attributes'] = array_intersect_key($attributes['attributes'], array_flip($whitelist));

This comment has been minimized.


gigorok Jan 3, 2019


a bit confusing as for me. will be better to track creatableAttributes & updatableAttributes (isNew()=>false) instead of getWhiteListAttributesKeys (has no difference between creation & updating). also getWhiteListAttributesKeys can return null (prevent whitelisting) or array

Fivell added some commits Jan 3, 2019

add ability to keep only whitelisted attributes
needed to  patch objects, without it all fetchable attributes will be included in payload

@Fivell Fivell force-pushed the did_patch_example branch from 0cb71a9 to 1f54051 Jan 4, 2019

@gigorok gigorok merged commit 739517a into add-examples Jan 4, 2019

@Fivell Fivell deleted the did_patch_example branch Jan 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment