I want to create a standard function that gets run once to get the Users
info from another table when a User logs in. I am using findBySlug in most
of the controllers (which is in the User table), but would rather use 1
function to get all the data I need for other parts of the site in 1
function and save it to the session rather than findBy over and over. But
where would i place such a function? In the app_controller or app_model?
 
Basically I have been finding the User by the slug, get the User.id from
that find and get the agent or investor from that id..which is a pain over
and over
 
Because of the site reqirements the Users are divided into 2 tables so they
Id's do not match. example
User.id 1, User.slug joesmith = Agent.id 1, Agent.user_id 1
User.id 2, User.slug billsmith  = Investor.id 1, Investor.user_id 2
User.id 3, User.slug kimsmith  = Investor.id 2, nvestor.user_id 3
User.id 4, User.slug jensmith  = Agent.id 2, Agent.user_id 4
User.id 5, User.slug briansmith  = Agent.id 3, Agent.user_id 5
 
Another thing I thought of would be how would I save records using the
Agent.user_id or Investor.user_id rather than Agent.id or Investor.id since
the User.id and Investor.user_id are the same? 
Change the 
'foreignKey' => 'agent_id', to 'agent_user_id'
 
Thanks
 
Dave

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to