For what additionalTables are used for ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Zuzz
    Member
    • Nov 2023
    • 47

    #1

    For what additionalTables are used for ?

    Dear sirs, please, For what additionalTables are used for ?



    "additionalTables": {
    "{entityType}Path": {
    "attributes": {
    "id": {
    "type": "id",
    "dbType": "integer",
    "len": 11,
    "autoincrement": true,
    "unique" : true
    },
    "ascendorId": {
    "type": "foreignId",
    "index": true
    },
    "descendorId": {
    "type": "foreignId",
    "index": true
    }
    }
    }
    }
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9536

    #2
    It's an internal feature. Not listed in the metadata reference, hence to be treated as a non-official feature. It creates an additional table to store additional data.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • Zuzz
      Member
      • Nov 2023
      • 47

      #3
      I copied it from CategoryTree.
      And additionalTables is used in where array with inCategory select.
      Is it nessesary to use additionalTables in tree entity ?

      Comment

      • Zuzz
        Member
        • Nov 2023
        • 47

        #4


        publicfunctionfind(SearchParams$searchParams, ?FindParams$params = null): RecordCollection

        $query = $selectBuilder
        ->from($this->entityType)
        ->withStrictAccessControl()
        ->withSearchParams($preparedSearchParams)
        ->withAdditionalApplierClassNameList(
        $this->createSelectApplierClassNameListProvider()->get($this->entityType)
        )
        ->build();

        $preparedSearchParams​ with inCategory (screenshot in attach) trasfered in $query with additionalTables in where (screenshot in attach )



        Attached Files

        Comment

        • Zuzz
          Member
          • Nov 2023
          • 47

          #5

          in
          private function applyInCategory()

          additionalTables generally used:

          $pathName = lcfirst($foreignEntity) .'Path';

          $queryBuilder->join(
          ucfirst($pathName),
          $pathName,
          [
          "{$pathName}.descendorId:" => "{$middleName}.{$key}",
          ]
          );







          Comment

          Working...