I am trying to extend a vTiger fork. There is a custom module/entity I created (readtest
). I want to populate its fields from json files.
I fail to understand the way vTiger entities are loaded: I could override a method in the entity class in that case, but it seems some external mechanism is in charge of that so doesn't seem the right way.
I tried to look into event handlers but I did not find one to be executed after entity data is loaded from database, before any further processing: this could be the optimal solution in that it would allow to run code to retrieve and set all the fields of the entity, but my use case does not seem to be supported.
I was thinking of a cron job that synchronizes the tables but that's a pretty ugly solution and would be my last resort.
What is the more practical way to make a 'read-only' entity with fields populated programmatically with php?