Send the model code, please.

MonkeyGirl wrote:
> Hi.
>
> I'd really appreciate it if anyone here could help me out. I'm trying
> to override CakePHP's table names using useTable, which is causing it
> to get a bit confused when it comes to linking the tables together.
>
> I've got a table called "people" which is being used by two models,
> "Customer" and "Employee". The reason I've overridden CakePHP's usual
> way of doing things is that both employees and customers should be
> able to log into the system, so they use the same username and
> password columns in the same table.
>
> Some other models are linked in to these ones. For example, one other
> model, "Timesheet", belongsTo "Employee". Is this correct, linking
> into the model name instead of the table name with belongsTo?
>
> The problem is that when trying to go to the page of one of these
> other models, such as "Timesheet", it looks for employee_id in its own
> table. There isn't a Timesheet.employee_id though, there's a
> Timesheet.person_id.
>
> I can change the column name to employee_id, which fixes this view,
> but breaks the view for employees themselves, which starts to complain
> that there's no Timesheet.person_id column.
>
> Does anyone know how I can get both views working at the same time
> please? I'd appreciate any help on the matter.
>
> Thank you,
> Zoe.
>
>
> >
>   


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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