Over the past weeks I have been working on a projectManagement snippet. To finalize the snippet I realy need some help. So I’m hoping you guys can think with me. And I’m sorry if my English is sometimes hard to read because it’s not my native language
So far I can:
- Register new users
- Create a project with user registration
- Create clients for projects
- Create fellow company members
- List projects
- Edit projects
In have 3 objectclasses (tables) called:
pmUsers,
pmProjects and
pmCompany.
pmUsers contains extended profile fields like firstname and surname
pmProjects contains projects
pmCompany contains company information
When a user submits a project for the first time he has to register himself in the orderprocess and the following steps are executed:
- The User gets registerd
- Firstname and surname are placed in the pmUsers table
- Filled in project information is added as a new project in the pmProjects table
- Company info is added to the pmCompany table
My question is: How do I link this info (tables) together? I’m thinking of a company identifier (company_id for example) which is added to all the tables as the user submits registration. But how do I get a unique number renerated which I can use?
The easiest way is to get the increment ID of the modx_users table copied to the company_id key as the data is written to the tables. Is it possible to get the new increment ID in modx_users and use it?
Or is it better to use composite and aggregate db relations? I have tried working with it but I can’t seem te figure out how to use it.
It has been a long post and hopefully someone can help me out so I can distribute my first snippet!
Thanks for al the effort so far
Rogier