I work with Drupal 6.x to create exercise / personal training programs, and I use CCK with Exercise and Program content types, where Program contains several header fields and a list of links to the exercise nodes it consists of. This works great, and I can manually create programs that work great. Now I want to create a module that can generate these programs automatically based on a number of algorithms developed by me, the process will look like this:
- Load all exercises into an array
- Download user personal data (previously entered)
- Set the most suitable exercises
- Create a new type of program content
- Save program
The exercise has a number of related attributes, and although I could do all of the above using SQL directly in tables, it would be rather complicated and would not seem correct. In step 1, I would like to load the exercises as an array of Exercise objects (node_load?), And then create a program object and save. Is such an approach like OO possible or do I have to resort to data manipulation directly?
source
share