Announcement

Collapse
No announcement yet.

New Entity Creation for Backend Use only

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

  • New Entity Creation for Backend Use only

    I would like to create a new Entity called: EntityA
    which is located in a custom module which is called: MyModule.

    All MyModule code is located inside:
    Code:
    <espo-root>/custom/Espo/Modules/MyModule
    I have created the following files inside the Module folder specified above:

    File: Resources/metadata/scopes/EntityA.json
    PHP Code:
    {
      
    "entity"true,
      
    "layouts"false,
      
    "tab"false,
      
    "module""MyModule"
    }​ 
    Does it need anything else specified in scopes?

    File: Resources/metadata/entityDefs/EntityA.json
    PHP Code:
    {
      
    "fields": {
        
    /** define all fields with types etc here **/
    ​  },
      
    "indexes": {
        
    /** define db indexes here **/
    ​  }

    Is anything else required here?
    Does it need language definitions in Resources/i18n/<lang>/EntityA.json if no usage in Frontend (UI)?


    Code:
    Controllers/EntityA.php
    Entities/EntityA.php
    Repositories/EntityA.php
    Is it required to define any of the following class definition files which solely extend from Core Classes, if the only usage will be CRUD operations through the EntityManager Class?

  • #2
    No need for:
    • Controller
    • Language
    • Repository (not needed in 99% cases)
    • metadata/clientDefs

    Comment


    • aldisa
      aldisa commented
      Editing a comment
      Thanks for the clarification!
Working...
X