Re: [symfony-users] Creating database SQL and Class Entities from a yaml file
On Fri, 11 Feb 2011 11:11:11 -0500, Tac Tacelosky tac...@gmail.com wrote: This is a newbie question, but I've read the page at http://docs.symfony-reloaded.org/guides/doctrine/orm/console.html several times and I'm missing some of the basic steps in getting from YAML to the set of Base / Peer classes. There is no Base classes with Doctrine 2. You should read the doc of Doctrine 2 :) I want to generate the MySQL schema from a yaml file, what command do I run? What I want to do is something like: php app\console_dev doctrine:generate:entities MyTable.yml You have to give the bundle name, not the filename. And the filename has to match the namespace of the entity (this is also explained in the doc) so MyTable.yml is not a valid one. but that's obviously not right. I assume it's possible to go from an existing database to the .yml files, or even directly to the generated entity classes, can anyone point me toward a simple example of how to do that? sf2/doctrine2 looks like a very powerful combination, and we're starting a new project that won't need to be live for a few months, so I'm thinking it's worth the risk to work with these new tools, but I miss the simple step-by-step that the propel-based documentation offers. Where did you find a Propel-based documentation for Symfony 2 ? On a related note, the documentation at http://docs.symfony-reloaded.org/guides/doctrine/orm/console.html would be much easier to read if there was at least a br / at the end of the lines, having :create in the middle isn't clear at all. I'm not sure dd is the best html tag to use there anyway, a formatted list would be fine, or use dd for each tag, not for a group of them. Thanks! Tac Btw, the up-to-date doc is at http://docs.symfony-reloaded.org/master/ -- Christophe | Stof -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Creating database SQL and Class Entities from a yaml file
Any suggestions for a video tutorial or a step by step Here's how to get a table in MySQL into a sf2 model using doctrine2. I see where it says things like MyBundle, but I'm still not sure if that's supposed to be a directory or what. Again, sorry for the newbie question! The propel stuff is obviously for sf1, and there are more examples of how to use it. I'm hoping that the layout still gets fixed, even at http://docs.symfony-reloaded.org/master/guides/doctrine/orm/console.html http://docs.symfony-reloaded.org/master/guides/doctrine/orm/console.htmlthe options are hard to read. Tac On Fri, Feb 11, 2011 at 11:19 AM, stof s...@notk.org wrote: On Fri, 11 Feb 2011 11:11:11 -0500, Tac Tacelosky tac...@gmail.com wrote: This is a newbie question, but I've read the page at http://docs.symfony-reloaded.org/guides/doctrine/orm/console.html several times and I'm missing some of the basic steps in getting from YAML to the set of Base / Peer classes. There is no Base classes with Doctrine 2. You should read the doc of Doctrine 2 :) I want to generate the MySQL schema from a yaml file, what command do I run? What I want to do is something like: php app\console_dev doctrine:generate:entities MyTable.yml You have to give the bundle name, not the filename. And the filename has to match the namespace of the entity (this is also explained in the doc) so MyTable.yml is not a valid one. but that's obviously not right. I assume it's possible to go from an existing database to the .yml files, or even directly to the generated entity classes, can anyone point me toward a simple example of how to do that? sf2/doctrine2 looks like a very powerful combination, and we're starting a new project that won't need to be live for a few months, so I'm thinking it's worth the risk to work with these new tools, but I miss the simple step-by-step that the propel-based documentation offers. Where did you find a Propel-based documentation for Symfony 2 ? On a related note, the documentation at http://docs.symfony-reloaded.org/guides/doctrine/orm/console.html would be much easier to read if there was at least a br / at the end of the lines, having :create in the middle isn't clear at all. I'm not sure dd is the best html tag to use there anyway, a formatted list would be fine, or use dd for each tag, not for a group of them. Thanks! Tac Btw, the up-to-date doc is at http://docs.symfony-reloaded.org/master/ -- Christophe | Stof -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Creating database SQL and Class Entities from a yaml file
On Fri, 11 Feb 2011 11:34:23 -0500, Tac Tacelosky tac...@gmail.com wrote: Any suggestions for a video tutorial or a step by step Here's how to get a table in MySQL into a sf2 model using doctrine2. I see where it says things like MyBundle, but I'm still not sure if that's supposed to be a directory or what. Again, sorry for the newbie question! The doctrine 2 doc describes how to creates entities so you really should look at it: http://www.doctrine-project.org/docs/orm/2.0/en/ The directory in the filesystem are supposed to match the namespace as this is the way the autoloader works to find the classes. You can look at the sandbox to see how a project should look: https://github.com/symfony/symfony-sandbox -- Christophe | Stof -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en