OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – Programming Questions Best practice for custom entity extending contact AND user

This topic contains 2 replies, has 2 voices, and was last updated by  Spurgeon 5 years, 4 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
  • #37643

    Spurgeon
    Participant

    Hi,

    For our usecase, we wish to have a self help option for our contacts (selected types), where they can login them selves with their own username and password and maintain their personal info which they are allowed to edit.

    Since the native OroUser entity has the login / password management capability (which the contact entity apparently doesnt have), is it possible to combine a contact and user entities and create a custom entity that can have the attributes of both the parent entities?

    If so, which would be the best approach to do this? Through GUI (entity manager) or extending a OroUser through code?

    The approach should be upgrade proof.

    Can you kindly help us with some inputs on this??

    Thanks!!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #37645

    Andrey Yatsenko
    Moderator

    There is no way to combine User and Contact. I see several options to resolve your issue:
    1) the easiest one, add extra fields that you want to use from Contact to a User entity, and manage only Users. this could be done from UI or the code.
    2) create a relation from User to a Contact entity and create a User automatically, based on contact information, each time Contact is created. This can be done from code with the regular doctrine entity listener to prePersist event

    #37646

    Spurgeon
    Participant

    Dear Andrey,

    Thanks a ton for your kind inputs. They are surely encouraging!

    Can you please give more details for approach 2 please? May be some pointer to a sample code.

    Thanks once again!
    God bless you!

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

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

Back to top