cakephp icon indicating copy to clipboard operation
cakephp copied to clipboard

6.0: Rename `EntityTrait::_accessible` property to something more appropriate

Open LordSimal opened this issue 2 years ago • 3 comments

Description

I never really liked the name of the _accessible property inside our Cake\Datasource\EntityTrait since just by its name it indicates some sort of permission system to prevent (general) access to specified properties inside PHP... which it doesn't do.

The concept of mass assignment is properly described in the Docs and the baked entity classes also have a somewhat suitable explenation of what is happening but still the property name itself is a bit missleading imho.

Here are some of my (bad) suggestions that came to my mind:

  • massAssignable (to be right on the nose but still what does assignable mean)
  • massEditable (although this also doesn't represent it correctly because $entity->set('myfield', 'value'); would also be blocked if myfield is set to false)

Would love to hear your thoughts on that one 😁

CakePHP Version

6.0

LordSimal avatar Oct 22 '23 17:10 LordSimal

massAssignable :+1:

ADmad avatar Oct 22 '23 18:10 ADmad

Given that most folks interact with mass-assignment via the ORM methods, what about patchable?

markstory avatar Oct 23 '23 01:10 markstory

This issue is stale because it has been open for 120 days with no activity. Remove the stale label or comment or this will be closed in 15 days

github-actions[bot] avatar Apr 30 '24 00:04 github-actions[bot]