Hi,
I am working with a Drupal 6.x system to create exercise / personal training programmes, and am using the CCK with content types of Exercise and Programme, where Programme contains a few header fields and a list of node references to the exercises it consists of. This works great and I can manually create programmes which work fine. I now wish to create a module which can generate these programs automatically based on a number of algorithms I have developed, the process will look like:
- Load all exercises into array
- Load users personal info (entered previously)
- Establish best suited exercises
- Create new programme content type
- Save programme
An Exercise has a number of related attributes and although I could do all of the above using SQL directly into the tables it would be quite complex and doesn't feel right. I would like in step 1 to load the exercises as an array of Exercise objects (node_load?), and then create a programme object and save. Is this OO type approach possible or do I have to resort to manipulating the data directly?
Thanks