Re: Here is my database schema,please peovide me model for his.

2009-12-05 Thread John Andersen
Thanks Marcelo,

I do know you can define your way around it, but if you anyway are
designing the database, then by following the standards you will avoid
this task. Anands database design certainly was not near anykind that
I would have designed, which is why I suggested Anand to follow the
CakePHP conventions/standards.

Enjoy,
   John

On Dec 4, 9:59 pm, Marcelo Andrade  wrote:
> On Thu, Dec 3, 2009 at 3:22 AM, John Andersen  wrote:
> > Sorry to say Anand, but your schema does not conform to what CakePHP
> > expects, which makes it difficult to make it work with CakePHP,
> > without specifying a lot of information.
>
> > Suggest you rethink your schema, so that:
> > 1) It conforms to CakePHP (table names plural, foreign keys equal
> > foreign key table name singular + underscore + 'id', etc.;
>
> Not really needed.  If you cannot conform to Cake conventions,
> just configure it.  Model attributes like $useTable, $useDbConfig,
> $primaryKey and $foreign_key for associations are your friends.
>
> http://book.cakephp.org/view/71/Model-Attributes
>
> Best regards.
>
> --
> MARCELO DE F. ANDRADE
> Belem, PA, Amazonia, Brazil
> Linux User #221105

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Here is my database schema,please peovide me model for his.

2009-12-04 Thread Walther
What you want is http://book.cakephp.org/view/113/Code-Generation-with-Bake

The Bake script will look at your database and automatically generate
the required model files. Use it!

On Dec 4, 11:59 pm, Marcelo Andrade  wrote:
> On Thu, Dec 3, 2009 at 3:22 AM, John Andersen  wrote:
> > Sorry to say Anand, but your schema does not conform to what CakePHP
> > expects, which makes it difficult to make it work with CakePHP,
> > without specifying a lot of information.
>
> > Suggest you rethink your schema, so that:
> > 1) It conforms to CakePHP (table names plural, foreign keys equal
> > foreign key table name singular + underscore + 'id', etc.;
>
> Not really needed.  If you cannot conform to Cake conventions,
> just configure it.  Model attributes like $useTable, $useDbConfig,
> $primaryKey and $foreign_key for associations are your friends.
>
> http://book.cakephp.org/view/71/Model-Attributes
>
> Best regards.
>
> --
> MARCELO DE F. ANDRADE
> Belem, PA, Amazonia, Brazil
> Linux User #221105

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Here is my database schema,please peovide me model for his.

2009-12-04 Thread Marcelo Andrade
On Thu, Dec 3, 2009 at 3:22 AM, John Andersen  wrote:
> Sorry to say Anand, but your schema does not conform to what CakePHP
> expects, which makes it difficult to make it work with CakePHP,
> without specifying a lot of information.
>
> Suggest you rethink your schema, so that:
> 1) It conforms to CakePHP (table names plural, foreign keys equal
> foreign key table name singular + underscore + 'id', etc.;

Not really needed.  If you cannot conform to Cake conventions,
just configure it.  Model attributes like $useTable, $useDbConfig,
$primaryKey and $foreign_key for associations are your friends.

http://book.cakephp.org/view/71/Model-Attributes

Best regards.

--
MARCELO DE F. ANDRADE
Belem, PA, Amazonia, Brazil
Linux User #221105

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Here is my database schema,please peovide me model for his.

2009-12-02 Thread anand angadi
Hi john,

Thanks a lot for your valuable result...will do accordingly...

Cheers:
Anand

On Thu, Dec 3, 2009 at 11:52 AM, John Andersen wrote:

> Sorry to say Anand, but your schema does not conform to what CakePHP
> expects, which makes it difficult to make it work with CakePHP,
> without specifying a lot of information.
>
> Suggest you rethink your schema, so that:
> 1) It conforms to CakePHP (table names plural, foreign keys equal
> foreign key table name singular + underscore + 'id', etc.;
> 2) Makes use of primary key auto numbering;
> 3) Each table has its own primary key (id) - not depending on another
> tables primary key (id);
> 4) Tinyint is only for boolean columns (true/false)!
>
> This will make it a lot easier to use by CakePHP and for the future
> maintenance!
>
> I myself would not consider using your schema! Use my previous post as
> a base for replanning your schema.
> Enjoy,
>   John
>
> On Dec 3, 7:42 am, anand angadi  wrote:
> > Hi john,
> >
> > No... here is table script attached... please take a look at it...u wil
> get
> > an idea...
> >
> > Cheers:
> > Anand
> >
> > On Wed, Dec 2, 2009 at 4:46 PM, John Andersen  >wrote:
> >
> > > Looks confusing, sorry :)
> >
> > > Trying to transform your tables into a workable ER model (not CakePHP
> > > model):
> >
> > > A user may have one or more phone numbers
> > > A user may have one or more addresses
> > > Each phone number belongs to one user
> > > Each address belongs to one user
> > > An address may have one or more details
> > > A detail belongs to one address
> >
> > > Tables:
> > > users
> > > - id (primary key, auto number)
> > > - other necessary columns that you may require.
> > > - created
> > > - modified
> >
> > > phonenumbers
> > > - id (primary key, auto number)
> > > - user_id (foreign key to table users)
> > > - other necessary columns that you may require.
> > > - created
> > > - modified
> >
> > > addresses
> > > - id (primary key, auto number)
> > > - user_id (foreign key to table users)
> > > - other necessary columns that you may require.
> > > - created
> > > - modified
> >
> > > addressdetails
> > > - id (primary key, auto number)
> > > - address_id (foreign key to table addresses)
> > > - other necessary columns that you may require.
> > > - created
> > > - modified
> >
> > > Do I understand your schema correctly?
> > >   John
> >
> > > On Dec 2, 11:11 am, anand angadi  wrote:
> > > > Hi John,
> >
> > > > Sorry here its attached now...
> >
> > > > Cheers:
> > > > Anand
> >
> > > >  shcema.bmp
> > > > 1299KViewDownload
> >
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help
> others
> > > with their CakePHP related questions.
> >
> > > 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
> >
> >
> >
> >  main.sql
> > 5KViewDownload
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Here is my database schema,please peovide me model for his.

2009-12-02 Thread John Andersen
Sorry to say Anand, but your schema does not conform to what CakePHP
expects, which makes it difficult to make it work with CakePHP,
without specifying a lot of information.

Suggest you rethink your schema, so that:
1) It conforms to CakePHP (table names plural, foreign keys equal
foreign key table name singular + underscore + 'id', etc.;
2) Makes use of primary key auto numbering;
3) Each table has its own primary key (id) - not depending on another
tables primary key (id);
4) Tinyint is only for boolean columns (true/false)!

This will make it a lot easier to use by CakePHP and for the future
maintenance!

I myself would not consider using your schema! Use my previous post as
a base for replanning your schema.
Enjoy,
   John

On Dec 3, 7:42 am, anand angadi  wrote:
> Hi john,
>
> No... here is table script attached... please take a look at it...u wil get
> an idea...
>
> Cheers:
> Anand
>
> On Wed, Dec 2, 2009 at 4:46 PM, John Andersen wrote:
>
> > Looks confusing, sorry :)
>
> > Trying to transform your tables into a workable ER model (not CakePHP
> > model):
>
> > A user may have one or more phone numbers
> > A user may have one or more addresses
> > Each phone number belongs to one user
> > Each address belongs to one user
> > An address may have one or more details
> > A detail belongs to one address
>
> > Tables:
> > users
> > - id (primary key, auto number)
> > - other necessary columns that you may require.
> > - created
> > - modified
>
> > phonenumbers
> > - id (primary key, auto number)
> > - user_id (foreign key to table users)
> > - other necessary columns that you may require.
> > - created
> > - modified
>
> > addresses
> > - id (primary key, auto number)
> > - user_id (foreign key to table users)
> > - other necessary columns that you may require.
> > - created
> > - modified
>
> > addressdetails
> > - id (primary key, auto number)
> > - address_id (foreign key to table addresses)
> > - other necessary columns that you may require.
> > - created
> > - modified
>
> > Do I understand your schema correctly?
> >   John
>
> > On Dec 2, 11:11 am, anand angadi  wrote:
> > > Hi John,
>
> > > Sorry here its attached now...
>
> > > Cheers:
> > > Anand
>
> > >  shcema.bmp
> > > 1299KViewDownload
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en
>
>
>
>  main.sql
> 5KViewDownload

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Here is my database schema,please peovide me model for his.

2009-12-02 Thread anand angadi
Hi john,

No... here is table script attached... please take a look at it...u wil get
an idea...

Cheers:
Anand



On Wed, Dec 2, 2009 at 4:46 PM, John Andersen wrote:

> Looks confusing, sorry :)
>
> Trying to transform your tables into a workable ER model (not CakePHP
> model):
>
> A user may have one or more phone numbers
> A user may have one or more addresses
> Each phone number belongs to one user
> Each address belongs to one user
> An address may have one or more details
> A detail belongs to one address
>
> Tables:
> users
> - id (primary key, auto number)
> - other necessary columns that you may require.
> - created
> - modified
>
> phonenumbers
> - id (primary key, auto number)
> - user_id (foreign key to table users)
> - other necessary columns that you may require.
> - created
> - modified
>
> addresses
> - id (primary key, auto number)
> - user_id (foreign key to table users)
> - other necessary columns that you may require.
> - created
> - modified
>
> addressdetails
> - id (primary key, auto number)
> - address_id (foreign key to table addresses)
> - other necessary columns that you may require.
> - created
> - modified
>
> Do I understand your schema correctly?
>   John
>
> On Dec 2, 11:11 am, anand angadi  wrote:
> > Hi John,
> >
> > Sorry here its attached now...
> >
> > Cheers:
> > Anand
> >
> >  shcema.bmp
> > 1299KViewDownload
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


main.sql
Description: Binary data


Re: Here is my database schema,please peovide me model for his.

2009-12-02 Thread John Andersen
Looks confusing, sorry :)

Trying to transform your tables into a workable ER model (not CakePHP
model):

A user may have one or more phone numbers
A user may have one or more addresses
Each phone number belongs to one user
Each address belongs to one user
An address may have one or more details
A detail belongs to one address

Tables:
users
- id (primary key, auto number)
- other necessary columns that you may require.
- created
- modified

phonenumbers
- id (primary key, auto number)
- user_id (foreign key to table users)
- other necessary columns that you may require.
- created
- modified

addresses
- id (primary key, auto number)
- user_id (foreign key to table users)
- other necessary columns that you may require.
- created
- modified

addressdetails
- id (primary key, auto number)
- address_id (foreign key to table addresses)
- other necessary columns that you may require.
- created
- modified

Do I understand your schema correctly?
   John

On Dec 2, 11:11 am, anand angadi  wrote:
> Hi John,
>
> Sorry here its attached now...
>
> Cheers:
> Anand
>
>  shcema.bmp
> 1299KViewDownload

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Here is my database schema,please peovide me model for his.

2009-12-02 Thread John Andersen
Hi Anand,

Sorry, I am using Google Groups, can't see any attachments.
   John

On Dec 2, 11:04 am, anand angadi  wrote:
> Hi John,
>
> Here I am attatching my database schema.So can you provide me the sample
> model.
>
> Cheers:
> Anand

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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