OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – Programming Questions Custom business logic

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

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #24796

    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
  • #24797

    Dima Soroka
    Keymaster

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

    #24798

    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:

    #24799

    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!

    #24800

    Ale Cerutti
    Participant

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

    #24801

    Dima Soroka
    Keymaster

    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.

    #24802

    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)

The forum ‘OroCRM – Programming Questions’ is closed to new topics and replies.

Back to top