Skip to content

How to create indexer for custom table

I want to create an indexer for my custom EAV entity (for learning purposes only).
I have the following tables:

custom_employee_entity
custom_employee_entity_datetime
custom_employee_entity_decimal
custom_employee_entity_int
custom_employee_entity_text
custom_employee_entity_varchar

In the table custom_employee_entity I have column first_name and for example, in the table custom_employee_entity_decimal I have the value of EAV attribute salary. So what I want is to create an indexer that will save (On update or by Schedule) employee names and salaries in some table so then I will be able to show it on the frontend, I know it’s not useful but as I said I just want to learn and understand how to implement something like this. Thanks for any help)