Developing Web Apps with Symfony2, Doctrine and MongoDB
 

Developing Web Apps with Symfony2, Doctrine and MongoDB

on

  • 8,211 views

This talk will introduce how to integrate Doctrine ODM with Symfony2 and leverage it's features to build web apps with MongoDB.

This talk will introduce how to integrate Doctrine ODM with Symfony2 and leverage it's features to build web apps with MongoDB.

Statistics

Views

Total Views
8,211
Views on SlideShare
7,384
Embed Views
827

Actions

Likes
4
Downloads
63
Comments
0

5 Embeds 827

http://www.mongodb.com 669
http://www.10gen.com 154
http://drupal1.10gen.cc 2
http://varnish1.10gen.cc 1
http://www.google.co.uk 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Developing Web Apps with Symfony2, Doctrine and MongoDB Presentation Transcript

  • 1. Developing Web Apps with Symfony2, Doctrine and MongoDB
  • 2. Who Am I?• Software Engineer at TechJini Solutions• Working with PHP/Symfony for last 4 years• @kertz on Twitter and Github
  • 3. The Whys?• Why Symfony2?• Why Doctrine?
  • 4. Symfony2• Made of reusable components•Acommunity that built Doctrine, Behat, Composer, Assetic and more• Thebackbone for future versions of Drupal & phpBB
  • 5. Doctrine• Highly configurable• Supports MySQL, PgSQL, Oracle, SQlite, MongoDB and CouchDB• Doctrine Query Language
  • 6. Installation• ComposerDependency Manager (http:// getcomposer.org)$ curl -s http://getcomposer.org/installer | php$ php composer.phar create-project symfony/framework-standard-edition sf-mongo 2.1.x-dev
  • 7. Adding MongoDB composer.json{ "require": { "doctrine/mongodb-odm-bundle": "3.0.*" }, "minimum-stability": "dev"}$ composer.phar update doctrine/mongodb-odm-bundle AppKernel.php
  • 8. Configuration config.ymldoctrine_mongodb: connections: default: server: mongodb://localhost:27017 options: {} default_database: sfmongo document_managers: default: auto_mapping: true
  • 9. Bundles• Why Bundles?• Creating your own bundles $ app/console generate:bundle
  • 10. Register Bundles AppKernel.php
  • 11. What are we building?•A simple image sharing app• Store/Retrieve images in/from GridFS• Allow comments for images
  • 12. The Document schema for images Image.php
  • 13. Controller for uploading images ImageController.php
  • 14. The template for uploading images new.html.twig
  • 15. Retrieving the images ImageController.php
  • 16. In Retrospect•A form to upload an image and add caption• Store images in MongoDB with GridFS• Retrieve images• That was quick, wasn’t it?
  • 17. The Document schema for comments Comment.php
  • 18. Add a reference to comments Image.php
  • 19. Controller for comments ImageController.php
  • 20. Viewing comments for images ImageController.php comments.html.twig
  • 21. In Retrospect (again)• Allow comments for image• Show comments for images by id
  • 22. Repositories & DQL• Create custom repositories• Using Doctrine Query Builder
  • 23. Repository for comments CommentRepository.php
  • 24. Set repository location Comment.php
  • 25. Calling Repository functions CommentController.php
  • 26. Bundles to watch• SonataAdminBundle http://github.com/sonata-project/SonataAdminBundle• FOSUserBundle http://github.com/FriendsOfSymfony/FOSUserBundle• FOQElasticaBundle http://github.com/Exercise/FOQElasticaBundle
  • 27. The End. Questions?