0

I was just wondering when it's recommended to set the attributes on a custom model? Would it be ok to set them within the model's constructor or not? I guess it depends on when defineAttributes() is called, right?

1

Depending on how your plugin is setup, you should likely be setting model attributes in your Services. Create a new Model object, set its attributes, then pass that Model to the proper Record and save it.

Of course, this all varies based on what you're doing with it. If you provide more information, I'll see if I can lend a hand.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy