{"id":99,"date":"2009-09-17T16:35:43","date_gmt":"2009-09-17T14:35:43","guid":{"rendered":"https:\/\/www.opengis.ch\/2009\/09\/17\/adapting-doctrineexport-grt-lua-to-symfony-standards\/"},"modified":"2020-04-29T16:08:00","modified_gmt":"2020-04-29T14:08:00","slug":"adapting-doctrineexport-grt-lua-to-symfony-standards","status":"publish","type":"post","link":"https:\/\/www.opengis.ch\/it\/2009\/09\/17\/adapting-doctrineexport-grt-lua-to-symfony-standards\/","title":{"rendered":"Adapting doctrineexport.grt.lua to symfony standards"},"content":{"rendered":"<p>Using Mysql workbench to visually design a data model for a symfony application is pretty cool. Thanks to the guys of <a href=\"https:\/\/code.google.com\/p\/mysql-workbench-doctrine-plugin\/\">https:\/\/code.google.com\/p\/mysql-workbench-doctrine-plugin\/<\/a> you can export the model to a YAML file ready for Doctrine.<!--more--><br \/>\nthe only problem I found using version 0.36 is that classes names are not in UpperCamelCase but in lowerCameCase and that if you have a table column that starts wit id (like idea) it gets cut to id (issue report: <a href=\"https:\/\/code.google.com\/p\/mysql-workbench-doctrine-plugin\/issues\/detail?id=15\">https:\/\/code.google.com\/p\/mysql-workbench-doctrine-plugin\/issues\/detail?id=15<\/a>). so here my two  modifications of the script to behave the way I want.<br \/>\nAt the end of function buildTableName(s) add:<\/p>\n<pre lang='lua'>if ( string.sub(s, 1, 2) == 'sf' or  string.sub(s, 1, 2) == 'Sf') then\n      -- same as lcfirst\n      s = string.lower(string.sub(s, 1, 2)) .. string.sub(s, 3, #s)\n    else\n      s = ucfirst(s)\n    end\n    return s<\/pre>\n<p>Comment out the content of the renameIdColumns function<\/p>\n<pre lang='lua'>function renameIdColumns(s)\n   -- s = string.gsub(s, \"(id%w+)\", function(v)\n   --      return \"id\"\n   --    end)\n   return s\nend\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Using Mysql workbench to visually design a data model for a symfony application is pretty cool. Thanks to the guys of https:\/\/code.google.com\/p\/mysql-workbench-doctrine-plugin\/ you can export the model to a YAML file ready for Doctrine.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_themeisle_gutenberg_block_has_review":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[28],"tags":[125,93],"class_list":["post-99","post","type-post","status-publish","format-standard","hentry","category-web-development","tag-qgis-org","tag-symfony"],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":108,"url":"https:\/\/www.opengis.ch\/it\/2009\/10\/10\/mysql-world-database-as-yaml-fixture\/","url_meta":{"origin":99,"position":0},"title":"MySql World Database as YAML fixture","author":"Marco Bernasocchi","date":"10 Ottobre 2009","format":false,"excerpt":"For Symfony application I'm developing I needed all the Region separated by continent (7 continents model). I converted the MySql World Database (https:\/\/dev.mysql.com\/doc\/world-setup\/en\/world-setup.html) to a YAML NestedSet fixture file. I just had to make 4 minor changes to it: - rename the 3 continents that had region with the same\u2026","rel":"","context":"In &quot;Web Development&quot;","block_context":{"text":"Web Development","link":"https:\/\/www.opengis.ch\/it\/category\/web-development\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":17,"url":"https:\/\/www.opengis.ch\/it\/2009\/07\/10\/symfony-project-on-bluehost-shared-hosting\/","url_meta":{"origin":99,"position":1},"title":"Symfony project on (bluehost) shared hosting","author":"Marco Bernasocchi","date":"10 Luglio 2009","format":false,"excerpt":"set up a working Symfony project (with SVN) on my bluehost shared hosting, this tutorial should work for other hosters with minor changes. What I wanted was to be able of using my account as a development server for a small group of developers that would automatically show the last\u2026","rel":"","context":"In &quot;Web Development&quot;","block_context":{"text":"Web Development","link":"https:\/\/www.opengis.ch\/it\/category\/web-development\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":116,"url":"https:\/\/www.opengis.ch\/it\/2010\/02\/17\/custom-php-5-3-1-with-apc-and-xdebug-on-dreamhost-shared-hosting\/","url_meta":{"origin":99,"position":2},"title":"Custom PHP 5.3.1 with APC and XDEBUG on (Dreamhost) Shared Host","author":"Marco Bernasocchi","date":"17 Febbraio 2010","format":false,"excerpt":"I've recently been setting up my new dreamhost for symfony projects deployment and the only thing the default PHP is missing is the support for APC (alternate php cache). So after looking at the dreamhost wiki I cleaned up and added some features to the one of the install scripts.\u2026","rel":"","context":"In &quot;Web Development&quot;","block_context":{"text":"Web Development","link":"https:\/\/www.opengis.ch\/it\/category\/web-development\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":12905,"url":"https:\/\/www.opengis.ch\/it\/2022\/06\/27\/swiss-qgis-user-group-meeting-berne-2022\/","url_meta":{"origin":99,"position":3},"title":"Swiss QGIS user group Meeting Berne 2022","author":"Fabian Binder","date":"27 Giugno 2022","format":false,"excerpt":"What a blast it was! The first QField user day in Bern with around 40 participants from Switzerland and neighbouring countries was packed with use case presentations and interesting discussions.","rel":"","context":"In &quot;Events&quot;","block_context":{"text":"Events","link":"https:\/\/www.opengis.ch\/it\/category\/events\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2022\/06\/P6153915-scaled.jpg?fit=1200%2C896&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2022\/06\/P6153915-scaled.jpg?fit=1200%2C896&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2022\/06\/P6153915-scaled.jpg?fit=1200%2C896&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2022\/06\/P6153915-scaled.jpg?fit=1200%2C896&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2022\/06\/P6153915-scaled.jpg?fit=1200%2C896&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":60,"url":"https:\/\/www.opengis.ch\/it\/2009\/07\/14\/activating-error-503-from-a-shell-script\/","url_meta":{"origin":99,"position":4},"title":"Activating error 503 from a shell script","author":"Marco Bernasocchi","date":"14 Luglio 2009","format":false,"excerpt":"During deployment of a new version of a website you might want to have your server returning an error 503 (temporarily unavailable). here a solution","rel":"","context":"In &quot;Web Development&quot;","block_context":{"text":"Web Development","link":"https:\/\/www.opengis.ch\/it\/category\/web-development\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":12927,"url":"https:\/\/www.opengis.ch\/de\/2022\/06\/27\/swiss-qgis-user-group-meeting-bern-2022\/","url_meta":{"origin":99,"position":5},"title":"Swiss QGIS user group Meeting Bern 2022","author":"Fabian Binder","date":"27 Giugno 2022","format":false,"excerpt":"What a blast it was! The first QField user day in Bern with around 40 participants from Switzerland and neighbouring countries was packed with use case presentations and interesting discussions.","rel":"","context":"In &quot;Events&quot;","block_context":{"text":"Events","link":"https:\/\/www.opengis.ch\/de\/category\/events-de\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2022\/06\/P6153915-scaled.jpg?fit=1200%2C896&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2022\/06\/P6153915-scaled.jpg?fit=1200%2C896&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2022\/06\/P6153915-scaled.jpg?fit=1200%2C896&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2022\/06\/P6153915-scaled.jpg?fit=1200%2C896&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2022\/06\/P6153915-scaled.jpg?fit=1200%2C896&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_shortlink":"https:\/\/wp.me\/pbdBtI-1B","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.opengis.ch\/it\/wp-json\/wp\/v2\/posts\/99","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.opengis.ch\/it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.opengis.ch\/it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.opengis.ch\/it\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.opengis.ch\/it\/wp-json\/wp\/v2\/comments?post=99"}],"version-history":[{"count":1,"href":"https:\/\/www.opengis.ch\/it\/wp-json\/wp\/v2\/posts\/99\/revisions"}],"predecessor-version":[{"id":11238,"href":"https:\/\/www.opengis.ch\/it\/wp-json\/wp\/v2\/posts\/99\/revisions\/11238"}],"wp:attachment":[{"href":"https:\/\/www.opengis.ch\/it\/wp-json\/wp\/v2\/media?parent=99"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.opengis.ch\/it\/wp-json\/wp\/v2\/categories?post=99"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.opengis.ch\/it\/wp-json\/wp\/v2\/tags?post=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}