Hello at all,

I want to write my first module. But I dont know how to implement hooks correctly.

What I want to do is the following:

There are 3 node types given, let's say Type A, B, C
Each of them can be either imported with feeds or edited.

Now I want a content type D, which shall be a merger from the other content types. Title from Type A, fields from B and C. Also I want to compute some fields from A (sum) and store the values in a field in Type D.

Everytime an import of multiple nodes of Type A is made or an edit of a node of Type A is made, I want to fetch the data from this nodes, calculate them and store them in Type D.

I know that I can do this with views without the need of writing a module or inserting a new database_table / node_type, but because there would be lots of contexts, filters and relationships I want to create this solution because of the performance reasons.

Can anybody explain me how to write "if status of any nodes from nody_type A, B, C has changed, then do the following..." ?

Thank you a lot,