Announcement

Collapse
No announcement yet.

Extend Repositories in Extension

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

  • Extend Repositories in Extension

    Hello,

    Right now you can overwrite a built in Service with an extension:

    But you can't do this with a Repository. Looking at the difference between RepositoryFactory and ServiceFactory the main difference I can see is that Espo supports overwriting Repositories via custom/Espo/Custom/Repositores, but not via an extension.

    Why is that? Would there be any interest in allowing this?

    I want to package up an extension which not only extends a built in type, but modifies it's beforeSave logic.

  • #2
    Sorry I should have searched better, the Real Estate extension does this, so I will learn from that. Thanks!

    Comment


    • #3
      Actually spoke too soon - using the method of the Real Estate extension requires me to completely copy all the layouts of the built in entity. I just want the facility if custom/Espo/Custom/Repositories but via an extension.

      Comment


      • #4
        You can put custom dir into extension package. Remove those certain files from gitignore to be able to commit them.

        Repositories are tied to their entities. So repository should be located in the module where entity is located. Either in custom. Services are not necessarily related to entities. Only record services are tied to their entities, they were supposed to be only a CRUD implementation but we put excess logic there, like convert lead, that is better to have in separate services.
        Last edited by yuri; 12-22-2016, 08:53 AM.

        Comment


        • #5
          Thanks for explaining Yuri. That makes sense.

          Comment

          Working...
          X