Additional field for User

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • a.slyzhko
    Senior Member
    • Oct 2023
    • 126

    #1

    Additional field for User

    Hi there!
    I have created not storable linkMultiple field in User entityDefs. To fill in it with data I need entity manager to perform some queries. My question is how to add this additional processing before User is passed to constructor or set with traits? I need this field on both front-end and back-end sides
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9639

    #2
    Maybe consider to do operations inside the class, where the user is passed to. You can call $user->loadLinkMultipleField('field');

    Comment

    • a.slyzhko
      Senior Member
      • Oct 2023
      • 126

      #3
      Will need this in many places. I don't want to copy/paste code. This is due to our company hierarchy. We have teams, sub-teams, supervisors. And I need to collect all supervised users recursively and pass their ids to supervisor user entity. This will be used in acl, services and other places. Any other ideas?

      Comment

      • yuri
        EspoCRM product developer
        • Mar 2014
        • 9639

        #4
        You can wrap the User into another class, optionally to make it a container service for performance reasons.

        Comment

        Working...