Re: Can Cake do this?
Cake is a programming language (well, PHP is), not an off the shelf application. It's abilities are - more or less - limited by your imagination, talent and hard work. Nothing that you mention here seems at all unreasonable (difficult, even), unless you expect it all to be there for you out of the box. Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 9 Jul 2010, at 03:50, Bill P. wrote: > ok, great. > Every framework sounds great and makes it sounds liek it can do anything, > until you actualy try to get it to work. > thanks for the feedback. > I will continue with the manual and tutorials. > Thanks > > > > From: Shaz > To: CakePHP > Sent: Thu, July 8, 2010 10:42:45 AM > Subject: Re: Can Cake do this? > > Easily doable in CakePHP - it may take you a week or two to get around > to Cake's way of doing things but stick with it. > > On Jul 7, 2:47 am, maxarbos wrote: > > I am just getting into learning about cake and wanted to know if I am > > going to be able to do the things I am hoping it can do, easily. > > > > The site I am going to use this for is a product rental agency. They > > have a number of categories with unlimited levels of parent to child > > relationships. Prices can be specific to three different categories > > (by 3 hours, by day, and by week) > > > > I would also like to be able to allow them to have a shopping carts of > > sorts that is mainly a shopping list. > > > > A site administrator would be able to add categories (with pictures of > > the categories) products with pics, change prices, etc.. > > > > SEO friendly URLs is a must as well. > > > > this all sounds pretty basic, so I am hoping this is all pretty > > standard and possible. > > > > thanks. > > Bill > > 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 > > > 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 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: Can Cake do this?
ok, great. Every framework sounds great and makes it sounds liek it can do anything, until you actualy try to get it to work. thanks for the feedback. I will continue with the manual and tutorials. Thanks From: Shaz To: CakePHP Sent: Thu, July 8, 2010 10:42:45 AM Subject: Re: Can Cake do this? Easily doable in CakePHP - it may take you a week or two to get around to Cake's way of doing things but stick with it. On Jul 7, 2:47 am, maxarbos wrote: > I am just getting into learning about cake and wanted to know if I am > going to be able to do the things I am hoping it can do, easily. > > The site I am going to use this for is a product rental agency. They > have a number of categories with unlimited levels of parent to child > relationships. Prices can be specific to three different categories > (by 3 hours, by day, and by week) > > I would also like to be able to allow them to have a shopping carts of > sorts that is mainly a shopping list. > > A site administrator would be able to add categories (with pictures of > the categories) products with pics, change prices, etc.. > > SEO friendly URLs is a must as well. > > this all sounds pretty basic, so I am hoping this is all pretty > standard and possible. > > thanks. > Bill 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: Can Cake do this?
Easily doable in CakePHP - it may take you a week or two to get around to Cake's way of doing things but stick with it. On Jul 7, 2:47 am, maxarbos wrote: > I am just getting into learning about cake and wanted to know if I am > going to be able to do the things I am hoping it can do, easily. > > The site I am going to use this for is a product rental agency. They > have a number of categories with unlimited levels of parent to child > relationships. Prices can be specific to three different categories > (by 3 hours, by day, and by week) > > I would also like to be able to allow them to have a shopping carts of > sorts that is mainly a shopping list. > > A site administrator would be able to add categories (with pictures of > the categories) products with pics, change prices, etc.. > > SEO friendly URLs is a must as well. > > this all sounds pretty basic, so I am hoping this is all pretty > standard and possible. > > thanks. > Bill 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: Can Cake do this?
If its possible in PHP, its possible in CakePHP. I suggest going through the blog and ACL tutorial to help get you started: http://book.cakephp.org/view/1527/Tutorials-Examples On Jul 6, 7:47 pm, maxarbos wrote: > I am just getting into learning about cake and wanted to know if I am > going to be able to do the things I am hoping it can do, easily. > > The site I am going to use this for is a product rental agency. They > have a number of categories with unlimited levels of parent to child > relationships. Prices can be specific to three different categories > (by 3 hours, by day, and by week) > > I would also like to be able to allow them to have a shopping carts of > sorts that is mainly a shopping list. > > A site administrator would be able to add categories (with pictures of > the categories) products with pics, change prices, etc.. > > SEO friendly URLs is a must as well. > > this all sounds pretty basic, so I am hoping this is all pretty > standard and possible. > > thanks. > Bill 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
Can Cake do this?
I am just getting into learning about cake and wanted to know if I am going to be able to do the things I am hoping it can do, easily. The site I am going to use this for is a product rental agency. They have a number of categories with unlimited levels of parent to child relationships. Prices can be specific to three different categories (by 3 hours, by day, and by week) I would also like to be able to allow them to have a shopping carts of sorts that is mainly a shopping list. A site administrator would be able to add categories (with pictures of the categories) products with pics, change prices, etc.. SEO friendly URLs is a must as well. this all sounds pretty basic, so I am hoping this is all pretty standard and possible. thanks. Bill 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: Can cake do this or am I asking too much
Hi JoC For me one of the things I like most about cake isn't so much managing all the associations (although that is very nice (indeed)) it is the fact that the rigid MVC structure makes it easy to find bits of code because everything has its own place in the structure and is logically organised. I think one of the main benefits is just that you don't 'loose' bits of code - if things aren't where you think they would be they are normally pretty easy to find (e.g. just moved into a component / element / helper etc.) John On Apr 29, 3:10 pm, JoC <[EMAIL PROTECTED]> wrote: > Hello all, > I am trying to write a maintenance software for a generator > distributing company. > The company works the following way > > 1 site has many generators > 1 generators has 1 manufacturer and many parts > 1 part has many generators > 1 manufacturer has many generators and many models > 1 model has one manufacturer > 1 part works for many generators > 1 manufacturer makes many models > . > . > . > > Anyways as you can see is a very complex system. To which then we will > add work orders, maintenance, etc.. > My questions is, will cake PHP make my life easier or harder I have > been working with it for about 1 week and so far its been ok until I > introduced the above concept today of many parts to many generators > etc then it got really complex. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Can cake do this or am I asking too much
"HABTM is only meant for 2 entities. How can you tell cake to handle a relationship of more than 2 entities (i.e. the join table has 3 or more foreign keys)?" You can access more fields in a HABTM join table using the "with" key in the HABTM relationship definition. I've only used extra fields in a join table to contain meta data about the relationship though, not additional foreign keys. You bring up a good point, creating a 3 Model join would be tricky at best using HABTM, It would be tricky any way you implement it. You could use "with" property to join the 3rd model, but if this were the case, you could ony retrieve the id, you couldn't get at the 3rd model recursively. If you defined the 3 join table as a model, then you'd be able to get at the data recursively, but you'd run into the data validation problems I mentioned above. On May 1, 1:31 am, zonium <[EMAIL PROTECTED]> wrote: > 1. Many times I create a complete MVC for the join table, especially > when I need to build complicated/flexible admin interfaces to work > directly with additional fields in the join table. > 2. I am not sure if cake can handle compound primary key of more than > 2 foreign keys. HABTM is only meant for 2 entities. How can you tell > cake to handle a relationship of more than 2 entities (i.e. the join > table has 3 or more foreign keys)? > > Zonium > > On 30 Tháng Tư, 15:23, "[EMAIL PROTECTED]" > > <[EMAIL PROTECTED]> wrote: > > The only real downsides I can see other than complicated code is that > > join tables will have a compound primary key which I don't think cake > > can handle very well (ie a primary key of (user_id,post_id)). if > > instead you use a primary key of id to get around this, and use > > user_id and post_id as just regular fields, you could very easily end > > up with duplicate data in your table if you aren't careful(ie two rows > > where id is different but user_id, post_id are the same). This will > > cause even more problems when you are trying to delete the M2M > > relationship, if there are multiple entries for the relationship, when > > you delete one the others will remain. Also, if you have related data > > in the join table and you try to grab it by finding the join table > > entry where user_id=$desiredUID AND post_id=$desiredPID, if there are > > multiple entries in the table that satisfy these conditions, then the > > data pulled may be incorrect. This seems like a data validation > > nightmare to me and using Cakes HABTM relationship takes care of all > > of these problems. > > > Also, I don't see why you'd ever want a controller functions for a > > join table though. The only time you'd need controller functions for a > > join table is if you were rendering a view for the join table and > > you'd definitely never want to do that. If you really wanted functions > > relating to the join table, they should be defined in the model of the > > related table and called from the controller that will be rendering > > the view. > > > Restating though, Any data that is related to the join table can be > > accessesed through a related model using the "with" function so any > > functions acting on the join table data could be easily implemented in > > the related Model. > > > On Apr 30, 3:57 pm, validkeys <[EMAIL PROTECTED]> wrote: > > > > I did it the way that i did it so that I could write controller > > > actions in the join table controller vs. in the relational tables. I > > > guess you could just write those actions in the M2M controllers, but > > > is it not cleaner to write those controller actions directly in the > > > controller of the join table? Also, it keeps it clean with regards to > > > creating custom model queries for the join table. > > > > David, as we are all trying to learn here, are their any definite > > > downsides to the way that I am doing it besides the output data? > > > > Thanks! > > > > On Apr 30, 5:37 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > > wrote: > > > > > The way that validkeys describes is the exact same way that CakePHP > > > > implements a HABTM relationship. It uses a join table just as > > > > described. There really is no need to do it the way validkeys > > > > describes, you don't need a controller and model for the join table, > > > > it will just make your output data and query conditions that much more > > > > complicated. If you need to get at extra data in the join table (data > > > > other than the primary key) use the "with" key in the HABTM > > > > relationship definition. > > > > > On Apr 30, 2:58 pm, validkeys <[EMAIL PROTECTED]> wrote: > > > > > > JoC, > > > > > > HABTM are good, but another way that I have been modeling M2M > > > > > relationships is the following: > > > > > > assume we had students and classes. One class has many students and > > > > > one student is in many classes > > > > > > classes --> | classes_students | <-- students > > > > > > 1. create tables for classes, classes_students and students > > > > > 2.
Re: Can cake do this or am I asking too much
1. Many times I create a complete MVC for the join table, especially when I need to build complicated/flexible admin interfaces to work directly with additional fields in the join table. 2. I am not sure if cake can handle compound primary key of more than 2 foreign keys. HABTM is only meant for 2 entities. How can you tell cake to handle a relationship of more than 2 entities (i.e. the join table has 3 or more foreign keys)? Zonium On 30 Tháng Tư, 15:23, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > The only real downsides I can see other than complicated code is that > join tables will have a compound primary key which I don't think cake > can handle very well (ie a primary key of (user_id,post_id)). if > instead you use a primary key of id to get around this, and use > user_id and post_id as just regular fields, you could very easily end > up with duplicate data in your table if you aren't careful(ie two rows > where id is different but user_id, post_id are the same). This will > cause even more problems when you are trying to delete the M2M > relationship, if there are multiple entries for the relationship, when > you delete one the others will remain. Also, if you have related data > in the join table and you try to grab it by finding the join table > entry where user_id=$desiredUID AND post_id=$desiredPID, if there are > multiple entries in the table that satisfy these conditions, then the > data pulled may be incorrect. This seems like a data validation > nightmare to me and using Cakes HABTM relationship takes care of all > of these problems. > > Also, I don't see why you'd ever want a controller functions for a > join table though. The only time you'd need controller functions for a > join table is if you were rendering a view for the join table and > you'd definitely never want to do that. If you really wanted functions > relating to the join table, they should be defined in the model of the > related table and called from the controller that will be rendering > the view. > > Restating though, Any data that is related to the join table can be > accessesed through a related model using the "with" function so any > functions acting on the join table data could be easily implemented in > the related Model. > > On Apr 30, 3:57 pm, validkeys <[EMAIL PROTECTED]> wrote: > > > I did it the way that i did it so that I could write controller > > actions in the join table controller vs. in the relational tables. I > > guess you could just write those actions in the M2M controllers, but > > is it not cleaner to write those controller actions directly in the > > controller of the join table? Also, it keeps it clean with regards to > > creating custom model queries for the join table. > > > David, as we are all trying to learn here, are their any definite > > downsides to the way that I am doing it besides the output data? > > > Thanks! > > > On Apr 30, 5:37 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > wrote: > > > > The way that validkeys describes is the exact same way that CakePHP > > > implements a HABTM relationship. It uses a join table just as > > > described. There really is no need to do it the way validkeys > > > describes, you don't need a controller and model for the join table, > > > it will just make your output data and query conditions that much more > > > complicated. If you need to get at extra data in the join table (data > > > other than the primary key) use the "with" key in the HABTM > > > relationship definition. > > > > On Apr 30, 2:58 pm, validkeys <[EMAIL PROTECTED]> wrote: > > > > > JoC, > > > > > HABTM are good, but another way that I have been modeling M2M > > > > relationships is the following: > > > > > assume we had students and classes. One class has many students and > > > > one student is in many classes > > > > > classes --> | classes_students | <-- students > > > > > 1. create tables for classes, classes_students and students > > > > 2. Create models and controllers for all 3 tables (note that the Model > > > > for the classes_students would be ClassesStudent) > > > > > Your classes and students models would have many classes_students > > > > > Your classes_students model would belong to classes and students. > > > > > Thats another way to set up the M2M relationship. > > > > > On Apr 29, 11:07 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > > > wrote: > > > > > > Cake can handle a many to many relationship just fine. Do a search for > > > > > HABTM (has and belongs to many) relationship to learn more about how > > > > > to do this. Cake has sort of a steep learning curve, especially if you > > > > > aren't familiar with MVC and OO programming. So, In my opinion Cake > > > > > will make this task MUCH easier for someone well versed in Cake or at > > > > > least well versed in MVC/OO. If you are just learning it will probably > > > > > make the task moderately easier but any future web programming you do > > > > > with it will be much easier and faster
Re: Can cake do this or am I asking too much
ok. that makes sense. i am currently working on a project where i have been using my, now apparently, brutal method for M2M. Ill change it over. You've sold me! On Apr 30, 6:23 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > The only real downsides I can see other than complicated code is that > join tables will have a compound primary key which I don't think cake > can handle very well (ie a primary key of (user_id,post_id)). if > instead you use a primary key of id to get around this, and use > user_id and post_id as just regular fields, you could very easily end > up with duplicate data in your table if you aren't careful(ie two rows > where id is different but user_id, post_id are the same). This will > cause even more problems when you are trying to delete the M2M > relationship, if there are multiple entries for the relationship, when > you delete one the others will remain. Also, if you have related data > in the join table and you try to grab it by finding the join table > entry where user_id=$desiredUID AND post_id=$desiredPID, if there are > multiple entries in the table that satisfy these conditions, then the > data pulled may be incorrect. This seems like a data validation > nightmare to me and using Cakes HABTM relationship takes care of all > of these problems. > > Also, I don't see why you'd ever want a controller functions for a > join table though. The only time you'd need controller functions for a > join table is if you were rendering a view for the join table and > you'd definitely never want to do that. If you really wanted functions > relating to the join table, they should be defined in the model of the > related table and called from the controller that will be rendering > the view. > > Restating though, Any data that is related to the join table can be > accessesed through a related model using the "with" function so any > functions acting on the join table data could be easily implemented in > the related Model. > > On Apr 30, 3:57 pm, validkeys <[EMAIL PROTECTED]> wrote: > > > I did it the way that i did it so that I could write controller > > actions in the join table controller vs. in the relational tables. I > > guess you could just write those actions in the M2M controllers, but > > is it not cleaner to write those controller actions directly in the > > controller of the join table? Also, it keeps it clean with regards to > > creating custom model queries for the join table. > > > David, as we are all trying to learn here, are their any definite > > downsides to the way that I am doing it besides the output data? > > > Thanks! > > > On Apr 30, 5:37 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > wrote: > > > > The way that validkeys describes is the exact same way that CakePHP > > > implements a HABTM relationship. It uses a join table just as > > > described. There really is no need to do it the way validkeys > > > describes, you don't need a controller and model for the join table, > > > it will just make your output data and query conditions that much more > > > complicated. If you need to get at extra data in the join table (data > > > other than the primary key) use the "with" key in the HABTM > > > relationship definition. > > > > On Apr 30, 2:58 pm, validkeys <[EMAIL PROTECTED]> wrote: > > > > > JoC, > > > > > HABTM are good, but another way that I have been modeling M2M > > > > relationships is the following: > > > > > assume we had students and classes. One class has many students and > > > > one student is in many classes > > > > > classes --> | classes_students | <-- students > > > > > 1. create tables for classes, classes_students and students > > > > 2. Create models and controllers for all 3 tables (note that the Model > > > > for the classes_students would be ClassesStudent) > > > > > Your classes and students models would have many classes_students > > > > > Your classes_students model would belong to classes and students. > > > > > Thats another way to set up the M2M relationship. > > > > > On Apr 29, 11:07 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > > > wrote: > > > > > > Cake can handle a many to many relationship just fine. Do a search for > > > > > HABTM (has and belongs to many) relationship to learn more about how > > > > > to do this. Cake has sort of a steep learning curve, especially if you > > > > > aren't familiar with MVC and OO programming. So, In my opinion Cake > > > > > will make this task MUCH easier for someone well versed in Cake or at > > > > > least well versed in MVC/OO. If you are just learning it will probably > > > > > make the task moderately easier but any future web programming you do > > > > > with it will be much easier and faster with Cake than developing > > > > > without a framework. > > > > > > Dave > > > > > > On Apr 29, 8:10 am, JoC <[EMAIL PROTECTED]> wrote: > > > > > > > Hello all, > > > > > > I am trying to write a maintenance software for a generator > > > > > > distributing company. > > > > > > T
Re: Can cake do this or am I asking too much
"just reread my note, hope i didn't sound like a jerk with the "as we are all trying to learn here..." line. I wish google groups had some sort of inflector::readNice() function. Ha! Appreciate your help " ;) NP I understood, yes we are all trying to learn here. On Apr 30, 4:11 pm, validkeys <[EMAIL PROTECTED]> wrote: > just reread my note, hope i didn't sound like a jerk with the "as we > are all trying to learn here..." line. I wish google groups had some > sort of inflector::readNice() function. Ha! Appreciate your help > > On Apr 30, 5:57 pm, validkeys <[EMAIL PROTECTED]> wrote: > > > I did it the way that i did it so that I could write controller > > actions in the join table controller vs. in the relational tables. I > > guess you could just write those actions in the M2M controllers, but > > is it not cleaner to write those controller actions directly in the > > controller of the join table? Also, it keeps it clean with regards to > > creating custom model queries for the join table. > > > David, as we are all trying to learn here, are their any definite > > downsides to the way that I am doing it besides the output data? > > > Thanks! > > > On Apr 30, 5:37 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > wrote: > > > > The way that validkeys describes is the exact same way that CakePHP > > > implements a HABTM relationship. It uses a join table just as > > > described. There really is no need to do it the way validkeys > > > describes, you don't need a controller and model for the join table, > > > it will just make your output data and query conditions that much more > > > complicated. If you need to get at extra data in the join table (data > > > other than the primary key) use the "with" key in the HABTM > > > relationship definition. > > > > On Apr 30, 2:58 pm, validkeys <[EMAIL PROTECTED]> wrote: > > > > > JoC, > > > > > HABTM are good, but another way that I have been modeling M2M > > > > relationships is the following: > > > > > assume we had students and classes. One class has many students and > > > > one student is in many classes > > > > > classes --> | classes_students | <-- students > > > > > 1. create tables for classes, classes_students and students > > > > 2. Create models and controllers for all 3 tables (note that the Model > > > > for the classes_students would be ClassesStudent) > > > > > Your classes and students models would have many classes_students > > > > > Your classes_students model would belong to classes and students. > > > > > Thats another way to set up the M2M relationship. > > > > > On Apr 29, 11:07 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > > > wrote: > > > > > > Cake can handle a many to many relationship just fine. Do a search for > > > > > HABTM (has and belongs to many) relationship to learn more about how > > > > > to do this. Cake has sort of a steep learning curve, especially if you > > > > > aren't familiar with MVC and OO programming. So, In my opinion Cake > > > > > will make this task MUCH easier for someone well versed in Cake or at > > > > > least well versed in MVC/OO. If you are just learning it will probably > > > > > make the task moderately easier but any future web programming you do > > > > > with it will be much easier and faster with Cake than developing > > > > > without a framework. > > > > > > Dave > > > > > > On Apr 29, 8:10 am, JoC <[EMAIL PROTECTED]> wrote: > > > > > > > Hello all, > > > > > > I am trying to write a maintenance software for a generator > > > > > > distributing company. > > > > > > The company works the following way > > > > > > > 1 site has many generators > > > > > > 1 generators has 1 manufacturer and many parts > > > > > > 1 part has many generators > > > > > > 1 manufacturer has many generators and many models > > > > > > 1 model has one manufacturer > > > > > > 1 part works for many generators > > > > > > 1 manufacturer makes many models > > > > > > . > > > > > > . > > > > > > . > > > > > > > Anyways as you can see is a very complex system. To which then we > > > > > > will > > > > > > add work orders, maintenance, etc.. > > > > > > My questions is, will cake PHP make my life easier or harder I have > > > > > > been working with it for about 1 week and so far its been ok until I > > > > > > introduced the above concept today of many parts to many generators > > > > > > etc then it got really complex. > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Can cake do this or am I asking too much
The only real downsides I can see other than complicated code is that join tables will have a compound primary key which I don't think cake can handle very well (ie a primary key of (user_id,post_id)). if instead you use a primary key of id to get around this, and use user_id and post_id as just regular fields, you could very easily end up with duplicate data in your table if you aren't careful(ie two rows where id is different but user_id, post_id are the same). This will cause even more problems when you are trying to delete the M2M relationship, if there are multiple entries for the relationship, when you delete one the others will remain. Also, if you have related data in the join table and you try to grab it by finding the join table entry where user_id=$desiredUID AND post_id=$desiredPID, if there are multiple entries in the table that satisfy these conditions, then the data pulled may be incorrect. This seems like a data validation nightmare to me and using Cakes HABTM relationship takes care of all of these problems. Also, I don't see why you'd ever want a controller functions for a join table though. The only time you'd need controller functions for a join table is if you were rendering a view for the join table and you'd definitely never want to do that. If you really wanted functions relating to the join table, they should be defined in the model of the related table and called from the controller that will be rendering the view. Restating though, Any data that is related to the join table can be accessesed through a related model using the "with" function so any functions acting on the join table data could be easily implemented in the related Model. On Apr 30, 3:57 pm, validkeys <[EMAIL PROTECTED]> wrote: > I did it the way that i did it so that I could write controller > actions in the join table controller vs. in the relational tables. I > guess you could just write those actions in the M2M controllers, but > is it not cleaner to write those controller actions directly in the > controller of the join table? Also, it keeps it clean with regards to > creating custom model queries for the join table. > > David, as we are all trying to learn here, are their any definite > downsides to the way that I am doing it besides the output data? > > Thanks! > > On Apr 30, 5:37 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > The way that validkeys describes is the exact same way that CakePHP > > implements a HABTM relationship. It uses a join table just as > > described. There really is no need to do it the way validkeys > > describes, you don't need a controller and model for the join table, > > it will just make your output data and query conditions that much more > > complicated. If you need to get at extra data in the join table (data > > other than the primary key) use the "with" key in the HABTM > > relationship definition. > > > On Apr 30, 2:58 pm, validkeys <[EMAIL PROTECTED]> wrote: > > > > JoC, > > > > HABTM are good, but another way that I have been modeling M2M > > > relationships is the following: > > > > assume we had students and classes. One class has many students and > > > one student is in many classes > > > > classes --> | classes_students | <-- students > > > > 1. create tables for classes, classes_students and students > > > 2. Create models and controllers for all 3 tables (note that the Model > > > for the classes_students would be ClassesStudent) > > > > Your classes and students models would have many classes_students > > > > Your classes_students model would belong to classes and students. > > > > Thats another way to set up the M2M relationship. > > > > On Apr 29, 11:07 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > > wrote: > > > > > Cake can handle a many to many relationship just fine. Do a search for > > > > HABTM (has and belongs to many) relationship to learn more about how > > > > to do this. Cake has sort of a steep learning curve, especially if you > > > > aren't familiar with MVC and OO programming. So, In my opinion Cake > > > > will make this task MUCH easier for someone well versed in Cake or at > > > > least well versed in MVC/OO. If you are just learning it will probably > > > > make the task moderately easier but any future web programming you do > > > > with it will be much easier and faster with Cake than developing > > > > without a framework. > > > > > Dave > > > > > On Apr 29, 8:10 am, JoC <[EMAIL PROTECTED]> wrote: > > > > > > Hello all, > > > > > I am trying to write a maintenance software for a generator > > > > > distributing company. > > > > > The company works the following way > > > > > > 1 site has many generators > > > > > 1 generators has 1 manufacturer and many parts > > > > > 1 part has many generators > > > > > 1 manufacturer has many generators and many models > > > > > 1 model has one manufacturer > > > > > 1 part works for many generators > > > > > 1 manufacturer makes many models > > > > > . > > > > > . > > > > >
Re: Can cake do this or am I asking too much
just reread my note, hope i didn't sound like a jerk with the "as we are all trying to learn here..." line. I wish google groups had some sort of inflector::readNice() function. Ha! Appreciate your help On Apr 30, 5:57 pm, validkeys <[EMAIL PROTECTED]> wrote: > I did it the way that i did it so that I could write controller > actions in the join table controller vs. in the relational tables. I > guess you could just write those actions in the M2M controllers, but > is it not cleaner to write those controller actions directly in the > controller of the join table? Also, it keeps it clean with regards to > creating custom model queries for the join table. > > David, as we are all trying to learn here, are their any definite > downsides to the way that I am doing it besides the output data? > > Thanks! > > On Apr 30, 5:37 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > The way that validkeys describes is the exact same way that CakePHP > > implements a HABTM relationship. It uses a join table just as > > described. There really is no need to do it the way validkeys > > describes, you don't need a controller and model for the join table, > > it will just make your output data and query conditions that much more > > complicated. If you need to get at extra data in the join table (data > > other than the primary key) use the "with" key in the HABTM > > relationship definition. > > > On Apr 30, 2:58 pm, validkeys <[EMAIL PROTECTED]> wrote: > > > > JoC, > > > > HABTM are good, but another way that I have been modeling M2M > > > relationships is the following: > > > > assume we had students and classes. One class has many students and > > > one student is in many classes > > > > classes --> | classes_students | <-- students > > > > 1. create tables for classes, classes_students and students > > > 2. Create models and controllers for all 3 tables (note that the Model > > > for the classes_students would be ClassesStudent) > > > > Your classes and students models would have many classes_students > > > > Your classes_students model would belong to classes and students. > > > > Thats another way to set up the M2M relationship. > > > > On Apr 29, 11:07 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > > wrote: > > > > > Cake can handle a many to many relationship just fine. Do a search for > > > > HABTM (has and belongs to many) relationship to learn more about how > > > > to do this. Cake has sort of a steep learning curve, especially if you > > > > aren't familiar with MVC and OO programming. So, In my opinion Cake > > > > will make this task MUCH easier for someone well versed in Cake or at > > > > least well versed in MVC/OO. If you are just learning it will probably > > > > make the task moderately easier but any future web programming you do > > > > with it will be much easier and faster with Cake than developing > > > > without a framework. > > > > > Dave > > > > > On Apr 29, 8:10 am, JoC <[EMAIL PROTECTED]> wrote: > > > > > > Hello all, > > > > > I am trying to write a maintenance software for a generator > > > > > distributing company. > > > > > The company works the following way > > > > > > 1 site has many generators > > > > > 1 generators has 1 manufacturer and many parts > > > > > 1 part has many generators > > > > > 1 manufacturer has many generators and many models > > > > > 1 model has one manufacturer > > > > > 1 part works for many generators > > > > > 1 manufacturer makes many models > > > > > . > > > > > . > > > > > . > > > > > > Anyways as you can see is a very complex system. To which then we will > > > > > add work orders, maintenance, etc.. > > > > > My questions is, will cake PHP make my life easier or harder I have > > > > > been working with it for about 1 week and so far its been ok until I > > > > > introduced the above concept today of many parts to many generators > > > > > etc then it got really complex. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Can cake do this or am I asking too much
I did it the way that i did it so that I could write controller actions in the join table controller vs. in the relational tables. I guess you could just write those actions in the M2M controllers, but is it not cleaner to write those controller actions directly in the controller of the join table? Also, it keeps it clean with regards to creating custom model queries for the join table. David, as we are all trying to learn here, are their any definite downsides to the way that I am doing it besides the output data? Thanks! On Apr 30, 5:37 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > The way that validkeys describes is the exact same way that CakePHP > implements a HABTM relationship. It uses a join table just as > described. There really is no need to do it the way validkeys > describes, you don't need a controller and model for the join table, > it will just make your output data and query conditions that much more > complicated. If you need to get at extra data in the join table (data > other than the primary key) use the "with" key in the HABTM > relationship definition. > > On Apr 30, 2:58 pm, validkeys <[EMAIL PROTECTED]> wrote: > > > JoC, > > > HABTM are good, but another way that I have been modeling M2M > > relationships is the following: > > > assume we had students and classes. One class has many students and > > one student is in many classes > > > classes --> | classes_students | <-- students > > > 1. create tables for classes, classes_students and students > > 2. Create models and controllers for all 3 tables (note that the Model > > for the classes_students would be ClassesStudent) > > > Your classes and students models would have many classes_students > > > Your classes_students model would belong to classes and students. > > > Thats another way to set up the M2M relationship. > > > On Apr 29, 11:07 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > wrote: > > > > Cake can handle a many to many relationship just fine. Do a search for > > > HABTM (has and belongs to many) relationship to learn more about how > > > to do this. Cake has sort of a steep learning curve, especially if you > > > aren't familiar with MVC and OO programming. So, In my opinion Cake > > > will make this task MUCH easier for someone well versed in Cake or at > > > least well versed in MVC/OO. If you are just learning it will probably > > > make the task moderately easier but any future web programming you do > > > with it will be much easier and faster with Cake than developing > > > without a framework. > > > > Dave > > > > On Apr 29, 8:10 am, JoC <[EMAIL PROTECTED]> wrote: > > > > > Hello all, > > > > I am trying to write a maintenance software for a generator > > > > distributing company. > > > > The company works the following way > > > > > 1 site has many generators > > > > 1 generators has 1 manufacturer and many parts > > > > 1 part has many generators > > > > 1 manufacturer has many generators and many models > > > > 1 model has one manufacturer > > > > 1 part works for many generators > > > > 1 manufacturer makes many models > > > > . > > > > . > > > > . > > > > > Anyways as you can see is a very complex system. To which then we will > > > > add work orders, maintenance, etc.. > > > > My questions is, will cake PHP make my life easier or harder I have > > > > been working with it for about 1 week and so far its been ok until I > > > > introduced the above concept today of many parts to many generators > > > > etc then it got really complex. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Can cake do this or am I asking too much
The way that validkeys describes is the exact same way that CakePHP implements a HABTM relationship. It uses a join table just as described. There really is no need to do it the way validkeys describes, you don't need a controller and model for the join table, it will just make your output data and query conditions that much more complicated. If you need to get at extra data in the join table (data other than the primary key) use the "with" key in the HABTM relationship definition. On Apr 30, 2:58 pm, validkeys <[EMAIL PROTECTED]> wrote: > JoC, > > HABTM are good, but another way that I have been modeling M2M > relationships is the following: > > assume we had students and classes. One class has many students and > one student is in many classes > > classes --> | classes_students | <-- students > > 1. create tables for classes, classes_students and students > 2. Create models and controllers for all 3 tables (note that the Model > for the classes_students would be ClassesStudent) > > Your classes and students models would have many classes_students > > Your classes_students model would belong to classes and students. > > Thats another way to set up the M2M relationship. > > On Apr 29, 11:07 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > Cake can handle a many to many relationship just fine. Do a search for > > HABTM (has and belongs to many) relationship to learn more about how > > to do this. Cake has sort of a steep learning curve, especially if you > > aren't familiar with MVC and OO programming. So, In my opinion Cake > > will make this task MUCH easier for someone well versed in Cake or at > > least well versed in MVC/OO. If you are just learning it will probably > > make the task moderately easier but any future web programming you do > > with it will be much easier and faster with Cake than developing > > without a framework. > > > Dave > > > On Apr 29, 8:10 am, JoC <[EMAIL PROTECTED]> wrote: > > > > Hello all, > > > I am trying to write a maintenance software for a generator > > > distributing company. > > > The company works the following way > > > > 1 site has many generators > > > 1 generators has 1 manufacturer and many parts > > > 1 part has many generators > > > 1 manufacturer has many generators and many models > > > 1 model has one manufacturer > > > 1 part works for many generators > > > 1 manufacturer makes many models > > > . > > > . > > > . > > > > Anyways as you can see is a very complex system. To which then we will > > > add work orders, maintenance, etc.. > > > My questions is, will cake PHP make my life easier or harder I have > > > been working with it for about 1 week and so far its been ok until I > > > introduced the above concept today of many parts to many generators > > > etc then it got really complex. > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Can cake do this or am I asking too much
JoC, HABTM are good, but another way that I have been modeling M2M relationships is the following: assume we had students and classes. One class has many students and one student is in many classes classes --> | classes_students | <-- students 1. create tables for classes, classes_students and students 2. Create models and controllers for all 3 tables (note that the Model for the classes_students would be ClassesStudent) Your classes and students models would have many classes_students Your classes_students model would belong to classes and students. Thats another way to set up the M2M relationship. On Apr 29, 11:07 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Cake can handle a many to many relationship just fine. Do a search for > HABTM (has and belongs to many) relationship to learn more about how > to do this. Cake has sort of a steep learning curve, especially if you > aren't familiar with MVC and OO programming. So, In my opinion Cake > will make this task MUCH easier for someone well versed in Cake or at > least well versed in MVC/OO. If you are just learning it will probably > make the task moderately easier but any future web programming you do > with it will be much easier and faster with Cake than developing > without a framework. > > Dave > > On Apr 29, 8:10 am, JoC <[EMAIL PROTECTED]> wrote: > > > Hello all, > > I am trying to write a maintenance software for a generator > > distributing company. > > The company works the following way > > > 1 site has many generators > > 1 generators has 1 manufacturer and many parts > > 1 part has many generators > > 1 manufacturer has many generators and many models > > 1 model has one manufacturer > > 1 part works for many generators > > 1 manufacturer makes many models > > . > > . > > . > > > Anyways as you can see is a very complex system. To which then we will > > add work orders, maintenance, etc.. > > My questions is, will cake PHP make my life easier or harder I have > > been working with it for about 1 week and so far its been ok until I > > introduced the above concept today of many parts to many generators > > etc then it got really complex. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Can cake do this or am I asking too much
Cake can handle a many to many relationship just fine. Do a search for HABTM (has and belongs to many) relationship to learn more about how to do this. Cake has sort of a steep learning curve, especially if you aren't familiar with MVC and OO programming. So, In my opinion Cake will make this task MUCH easier for someone well versed in Cake or at least well versed in MVC/OO. If you are just learning it will probably make the task moderately easier but any future web programming you do with it will be much easier and faster with Cake than developing without a framework. Dave On Apr 29, 8:10 am, JoC <[EMAIL PROTECTED]> wrote: > Hello all, > I am trying to write a maintenance software for a generator > distributing company. > The company works the following way > > 1 site has many generators > 1 generators has 1 manufacturer and many parts > 1 part has many generators > 1 manufacturer has many generators and many models > 1 model has one manufacturer > 1 part works for many generators > 1 manufacturer makes many models > . > . > . > > Anyways as you can see is a very complex system. To which then we will > add work orders, maintenance, etc.. > My questions is, will cake PHP make my life easier or harder I have > been working with it for about 1 week and so far its been ok until I > introduced the above concept today of many parts to many generators > etc then it got really complex. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Can cake do this or am I asking too much
Hello all, I am trying to write a maintenance software for a generator distributing company. The company works the following way 1 site has many generators 1 generators has 1 manufacturer and many parts 1 part has many generators 1 manufacturer has many generators and many models 1 model has one manufacturer 1 part works for many generators 1 manufacturer makes many models . . . Anyways as you can see is a very complex system. To which then we will add work orders, maintenance, etc.. My questions is, will cake PHP make my life easier or harder I have been working with it for about 1 week and so far its been ok until I introduced the above concept today of many parts to many generators etc then it got really complex. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---