Re: Models, Tables, and Database Normalization

2009-10-19 Thread Jamie

Also, Jon, keep in mind that Cake will attempt to create a model on
the fly (basically AppModel) if it cannot find a model class for a
particular table. So if you create a contact_emails table, for
example, but you don't make a ContactEmail model class, then your app
will still work - you just won't be able to make any custom code for
your contact_emails table.

As Miles mentioned, however, less files isn't always best, and while
you can run an app this way (i.e. letting Cake instantiate AppModel on
the fly), you really should make all of your model files.

- Jamie

On Oct 18, 5:28 pm, Jon Lyles  wrote:
> Dear robustsolution and Miles J,
>
> Thank you both for answering my question.
>
> On 10/18/09, Miles J  wrote:
>
>
>
>
>
> > Yes a model represents a database table and deals with the business
> > logic for that table. So yes, you would most likely need 1 model per
> > table. Less files is not always best.
>
> > On Oct 18, 8:16 am, robustsolution  wrote:
> >> as for particular cases, I need more information
>
> >> On Oct 18, 6:13 pm, robustsolution  wrote:
>
> >> > Dear jonlyles
>
> >> > In general and if you stick to MVC then
>
> >> > M is required for each T (table)
>
> >> > C is for ZERO or more M
>
> >> > V is for 1 or more A (action)
>
> >> > A requires ZERO or 1 view
>
> >> > a for particular cases, I need more information
>
> --
> Sent from my mobile device
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Models, Tables, and Database Normalization

2009-10-18 Thread Jon Lyles

Dear robustsolution and Miles J,

Thank you both for answering my question.






On 10/18/09, Miles J  wrote:
>
> Yes a model represents a database table and deals with the business
> logic for that table. So yes, you would most likely need 1 model per
> table. Less files is not always best.
>
> On Oct 18, 8:16 am, robustsolution  wrote:
>> as for particular cases, I need more information
>>
>> On Oct 18, 6:13 pm, robustsolution  wrote:
>>
>> > Dear jonlyles
>>
>> > In general and if you stick to MVC then
>>
>> > M is required for each T (table)
>>
>> > C is for ZERO or more M
>>
>> > V is for 1 or more A (action)
>>
>> > A requires ZERO or 1 view
>>
>> > a for particular cases, I need more information
> >
>

-- 
Sent from my mobile device

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



Re: Models, Tables, and Database Normalization

2009-10-18 Thread Miles J

Yes a model represents a database table and deals with the business
logic for that table. So yes, you would most likely need 1 model per
table. Less files is not always best.

On Oct 18, 8:16 am, robustsolution  wrote:
> as for particular cases, I need more information
>
> On Oct 18, 6:13 pm, robustsolution  wrote:
>
> > Dear jonlyles
>
> > In general and if you stick to MVC then
>
> > M is required for each T (table)
>
> > C is for ZERO or more M
>
> > V is for 1 or more A (action)
>
> > A requires ZERO or 1 view
>
> > a for particular cases, I need more information
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Models, Tables, and Database Normalization

2009-10-18 Thread robustsolution

as for particular cases, I need more information

On Oct 18, 6:13 pm, robustsolution  wrote:
> Dear jonlyles
>
> In general and if you stick to MVC then
>
> M is required for each T (table)
>
> C is for ZERO or more M
>
> V is for 1 or more A (action)
>
> A requires ZERO or 1 view
>
> a for particular cases, I need more information
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Models, Tables, and Database Normalization

2009-10-18 Thread robustsolution

Dear jonlyles

In general and if you stick to MVC then

M is required for each T (table)

C is for ZERO or more M

V is for 1 or more A (action)

A requires ZERO or 1 view

a for particular cases, I need more information
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Models, Tables, and Database Normalization

2009-10-18 Thread jonlyles

Hi,

I'm fairly new to this group and have been enjoying and learning from
the exchanges for about a week now.

I have a simple question that I cannot see explicitly answered
anywhere.

Let's say I want to create a table in my database to keep track of my
contacts. Because of database normalization I end of with four tables:

contacts
contact_emails (contact_id)
contact_numbers(contact_id)
companies(contact_id)

So my question is.. am I obligated to build a model for each table or
can I create a model and controller and views for only `Contact` ?

Thank you in advance for all answers

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