Re: Cake 2 : Any sort of automatic schema creation from models?
I read through the very minimal bake command documentation at: 9.1 and 9.2 in the docs, but it's pretty superficial. The generation of the schema is a pretty big deal i think and something that should be highlighted a little more, if this is what it can do. When I started with cake 1.3 a few months ago, I didnt see anything that outlined this function. Going through some of the tutorials were pretty lacking as well. If there is someplace that has better information on this process, please let me know and I would love to review it. Thanks. On Jan 27, 1:38 am, Ryan Schmidt google-2...@ryandesign.com wrote: On Jan 26, 2011, at 00:48, maxarbos wrote: So would the model be automatically be built with the correct properties and types by telling it which table to read from? That's what cake bake is all about, isn't it? Have you tried it? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Cake 2 : Any sort of automatic schema creation from models?
I was responding to the the post from Ryan about 'bake' doing what I was asking for. When I 'run' a project in grails, that is when the table construction from a model is done, so i thought there was more to 'bake' than I had originally thought. I did go through the blog tutorial as well as the docs on how to create a model. And from what I remember, in both places I had to create the db table myself. You give the docs too much credit to think that in 15 minutes I am supposed to understand why I have to create the db table: 'posts' by hand (http://book.cakephp.org/view/1530/Creating-the-Blog-Database) and then little bit later have to create a model 'Post' with only a property of 'name' that = 'Post' with no other methods. And even then, the reason for that '$name' property isnt exactly clear as to why it's needed: 'The $name variable is always a good idea to add, and is used to overcome some class name oddness in PHP4.' I can understand the logic that the model is an interface to that table, but I dont remember seeing that outlined anywhere. So back to my original questions and just to be clear what you are saying is that the only way a table and it's rows are created are by manually creating them in the db myself, right? On Jan 28, 2:44 pm, AD7six andydawso...@gmail.com wrote: On Jan 28, 5:04 pm, maxarbos maxar...@yahoo.com wrote: I read through the very minimal bake command documentation at: 9.1 and 9.2 in the docs, but it's pretty superficial. The generation of the schema is a pretty big deal i think and something that should be highlighted a little more, if this is what it can do. When I started with cake 1.3 a few months ago, bake has very little to do with your question In cake you edit your db tables however you want and create a model file to represent your php interface to that table. Creating model files is actually optional since cake will use an app model instance for any referenced model which doesn't have a specific file. Therefore if you add a table to your db foos and add this to your e.g. user model: var hasMany = array('Foo'); you can immediately do $this-Foo-find() in/from your user model. The blog tutorial should have cemented this for you in the first 15 minute of using cake - if that wasn't the case for you I'd suggest you edit the bit that didn't clarify that's how cake works. AD -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Cake 2 : Any sort of automatic schema creation from models?
Hello, Will cake2 have any sort of automatic table schema creation and management? I have been using grails for a bit and it has an orm built in that creates and manages table schemas. So to create a table for people i create a class: People and add properties for firstName, lastName, etc... and if there is no 'People' table, one is created with the fields: 'first_name', 'last_name'. if i remove any property, that column is dropped. I would prefer to not have to manage the tables and FK relationships independantly of the application. (grails gives you the ability to set specific field types, sizes, etc..but defaults to certain types/sizes for 'Integer', 'String', etc...) I see a package RedBeanPHP, but cannot get it working (due to my knowledge limit on it) with the other LIght framework I am testing out. Thanks. Cake 2 : Any sort of automatic schema creation from models? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Cake 2 : Any sort of automatic schema creation from models?
So would the model be automatically be built with the correct properties and types by telling it which table to read from? If I just have to setup the tables, that would work too, but what I dont want is to have to maintain a model as well as a table structure independently. On Jan 25, 7:02 pm, mark_story mark.st...@gmail.com wrote: No. Cake has always taken the approach of basing the models off the schema, not the other way around. This is not planned to change for 2.0. -Mark On Jan 25, 2:56 pm, maxarbos maxar...@yahoo.com wrote: Hello, Will cake2 have any sort of automatic table schema creation and management? I have been using grails for a bit and it has an orm built in that creates and manages table schemas. So to create a table for people i create a class: People and add properties for firstName, lastName, etc... and if there is no 'People' table, one is created with the fields: 'first_name', 'last_name'. if i remove any property, that column is dropped. I would prefer to not have to manage the tables and FK relationships independantly of the application. (grails gives you the ability to set specific field types, sizes, etc..but defaults to certain types/sizes for 'Integer', 'String', etc...) I see a package RedBeanPHP, but cannot get it working (due to my knowledge limit on it) with the other LIght framework I am testing out. Thanks. Cake 2 : Any sort of automatic schema creation from models? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
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