First of all i'm sorry about the name of this question i had a hard time figure out what to call it:
Here is my problem i have the following two data tables:
Users
Employees.
These two data-tables are connected in a 1 to 1 relationship
Now both of these has a Model a view and a controller. Now my question is kinda split into two parts first the hard part:
Whenever an employee wants to create a new user (new employee) he has to insert the data into two tables first in the users
table and then after getting the user_id
add a record in the employee
table
the employee table looks like this:
users_idUsers client_id
Where users_idUsers
is the userid
from the user table
How will i go around this? is it possible to add the functions of another model into my employee model?
The second question is kinda an extension of this and is relatively simple.. i want to display all the employees however the view should be joined with the users so that you can see the username of the person in the view.
It should be said that i am quite new to Cake so i hope that some of you will be able to help me out.