Announcement

Collapse
No announcement yet.

Orm help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Orm help

    Hi I've noticed after adding a new Entity type that the names for the join tables to other entities varies and this is the case for the existing modules:

    eg these exist by default:

    lead_meeting

    meeting_user

    this means it's hard to write shared code where you can reference tables using something like {$scope}_meeting

    Where could I fix this?

  • #2
    use relationName in links definitions


    PHP Code:
    "links": {
            
    "contracts": {
                
    "type""hasMany",
                
    "entity""Contract",
                
    "relationName""AccountContract"
            
    }

    That will create account_contract table

    Comment


    • #3
      It's a commonly used standard where join table parts are sorted aplhabeticaly

      Comment


      • #4
        Ah thanks, I totally wasn't aware of that standard, and since posting saw how it's handled with $joinTable in Modules/Crm/Services/Activities.php.

        Comment

        Working...
        X