vierge-noire / cakephp-fixture-factories

CakePHP Fixture Factories
https://vierge-noire.github.io/
MIT License
83 stars 21 forks source link

Skip cake entity setter when set fields data #165

Closed Erwane closed 2 years ago

Erwane commented 2 years ago

When setting data (with make(), setField() or patchData()), if the entity have a _setField() method, the data is altered. It will be nice to add an option to skip this setters.

There is two ways to deactivate usage of setters :

pabloelcolombiano commented 2 years ago

Thanks @Erwane for the interesting proposal. I suppose that this could be useful for costly setters, such as hashing of passwords.

The approach I propose is:

pabloelcolombiano commented 2 years ago

@Erwane here is a PR you might want to have a look at.

Erwane commented 2 years ago

Very nice. I just added a comment on DataCompiler::setSkippedSetters

pabloelcolombiano commented 2 years ago

I cannot see your comment @Erwane ?

Erwane commented 2 years ago

https://github.com/vierge-noire/cakephp-fixture-factories/pull/166#issuecomment-1171280277