ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

This topic contains 6 replies, has 2 voices, and was last updated by Ale Cerutti Ale Cerutti 2 years, 8 months ago.

  • Creator
    Topic
  • #4570
    Ale Cerutti
    Ale Cerutti
    Participant

    Hi! Is there a way to customize the logic from an OroCRM entity method? I used Migration to extend the entity fields but, i like to add some custom logic to those fields. Is there a way to do that or i should put all that logic in the Controller?

    Thanks! and sorry for my English.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #4578
    Dima Soroka
    Dima Soroka
    Oro Core

    Please describe your use case and we’ll be able to recommend you a proper solution.

    #4580
    Ale Cerutti
    Ale Cerutti
    Participant

    I’d extend Contac entity adding some extra fields by using Migrations. Now, I have to put some custom business logic in Contac entity that use those extra field, for example:

    #4581
    Ale Cerutti
    Ale Cerutti
    Participant

    Dima,

    I’d extend Contac entity adding some extra attributes by using Migrations. Now, I have to put some custom business logic in Contac entity that use those extra attributes and/or another Contant’s attributes. In other words, i want to put a custom method in Contact but i don’t want modify Contact entity in /vendor.

    Thanks!

    #4585
    Ale Cerutti
    Ale Cerutti
    Participant

    Dima, Sorry.. The commnent #4580 was a mistake!

    #4592
    Dima Soroka
    Dima Soroka
    Oro Core

    I would recommend to move any business logic to separate class/service. This will allow to use entity as data model and implement multiple additions to this data in different bundles.

    Please let me know if you are looking for something else.

    #4611
    Ale Cerutti
    Ale Cerutti
    Participant

    Thanks Dima! That clarifies for me a lot! I’ll implement a service for business logic.

    Greetings!

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.