Persistence in PHP with Doctrine ORM
()
About this ebook
Related to Persistence in PHP with Doctrine ORM
Related ebooks
Mastering PHP Design Patterns Rating: 0 out of 5 stars0 ratingsApache Solr PHP Integration Rating: 0 out of 5 stars0 ratingsMongoDB High Availability Rating: 5 out of 5 stars5/5Go Programming Cookbook: Over 75+ recipes to program microservices, networking, database and APIs using Golang Rating: 0 out of 5 stars0 ratingsModular Programming with PHP 7 Rating: 0 out of 5 stars0 ratingsFlutter and Dart: Up and Running: Build native apps for both iOS and Android using a single codebase (English Edition) Rating: 0 out of 5 stars0 ratingsInstant Redis Optimization How-to Rating: 0 out of 5 stars0 ratingsInstant Hands-on Testing with PHPUnit How-to Rating: 0 out of 5 stars0 ratingsAdministrating Solr Rating: 0 out of 5 stars0 ratingsGetting Started with Grunt: The JavaScript Task Runner Rating: 3 out of 5 stars3/5Learning PHP Data Objects Rating: 5 out of 5 stars5/5Opa Application Development Rating: 0 out of 5 stars0 ratingsJasmine JavaScript Testing - Second Edition Rating: 0 out of 5 stars0 ratingsInstant Handlebars.js Rating: 0 out of 5 stars0 ratingsPHP 7 Data Structures and Algorithms Rating: 0 out of 5 stars0 ratingsLearning PHP 7 High Performance Rating: 0 out of 5 stars0 ratingsBuilding Python Real-Time Applications with Storm Rating: 0 out of 5 stars0 ratingsPractical Django 2 and Channels 2: Building Projects and Applications with Real-Time Capabilities Rating: 0 out of 5 stars0 ratingsPHPEclipse: A User Guide Rating: 3 out of 5 stars3/5Deploying Node.js Rating: 5 out of 5 stars5/5Java Web Developer A Complete Guide Rating: 0 out of 5 stars0 ratingsMastering Symfony Rating: 0 out of 5 stars0 ratingsPHP Error Reporting: How To Do It Right Rating: 0 out of 5 stars0 ratingsHybrid Mobile Development with Ionic Rating: 0 out of 5 stars0 ratingsMicrosoft Conversational AI Platform for Developers: End-to-End Chatbot Development from Planning to Deployment Rating: 0 out of 5 stars0 ratingsInstant Node Package Manager Rating: 2 out of 5 stars2/5Restlet in Action: Developing RESTful web APIs in Java Rating: 0 out of 5 stars0 ratingsJava with TDD from the Beginning Rating: 0 out of 5 stars0 ratingsPHP Reactive Programming Rating: 0 out of 5 stars0 ratingsSoftware Design Pattern A Complete Guide - 2020 Edition Rating: 0 out of 5 stars0 ratings
Internet & Web For You
Coding For Dummies Rating: 5 out of 5 stars5/5Get Rich or Lie Trying: Ambition and Deceit in the New Influencer Economy Rating: 0 out of 5 stars0 ratingsGrokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5Six Figure Blogging Blueprint Rating: 5 out of 5 stars5/5How to Be Invisible: Protect Your Home, Your Children, Your Assets, and Your Life Rating: 4 out of 5 stars4/5No Place to Hide: Edward Snowden, the NSA, and the U.S. Surveillance State Rating: 4 out of 5 stars4/5How to Disappear and Live Off the Grid: A CIA Insider's Guide Rating: 0 out of 5 stars0 ratingsMore Porn - Faster!: 50 Tips & Tools for Faster and More Efficient Porn Browsing Rating: 3 out of 5 stars3/5Podcasting For Dummies Rating: 4 out of 5 stars4/5The Beginner's Affiliate Marketing Blueprint Rating: 4 out of 5 stars4/5The Logo Brainstorm Book: A Comprehensive Guide for Exploring Design Directions Rating: 4 out of 5 stars4/5Social Engineering: The Science of Human Hacking Rating: 3 out of 5 stars3/5Remote/WebCam Notarization : Basic Understanding Rating: 3 out of 5 stars3/5Wireless Hacking 101 Rating: 4 out of 5 stars4/5Everybody Lies: Big Data, New Data, and What the Internet Can Tell Us About Who We Really Are Rating: 4 out of 5 stars4/5The Hacker Crackdown: Law and Disorder on the Electronic Frontier Rating: 4 out of 5 stars4/5Cybersecurity For Dummies Rating: 4 out of 5 stars4/5How To Start A Profitable Authority Blog In Under One Hour Rating: 5 out of 5 stars5/5How To Make Money Blogging: How I Replaced My Day-Job With My Blog and How You Can Start A Blog Today Rating: 4 out of 5 stars4/5The Digital Marketing Handbook: A Step-By-Step Guide to Creating Websites That Sell Rating: 5 out of 5 stars5/5The Gothic Novel Collection Rating: 5 out of 5 stars5/5How To Start A Podcast Rating: 4 out of 5 stars4/5Stop Asking Questions: How to Lead High-Impact Interviews and Learn Anything from Anyone Rating: 5 out of 5 stars5/5Beginner's Guide To Starting An Etsy Print-On-Demand Shop Rating: 0 out of 5 stars0 ratings
Reviews for Persistence in PHP with Doctrine ORM
0 ratings0 reviews
Book preview
Persistence in PHP with Doctrine ORM - Kévin Dunglas
Table of Contents
Persistence in PHP with Doctrine ORM
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Started with Doctrine 2
Prerequisites
Understanding the concepts behind Doctrine
Creating a project structure
Installing Composer
Installing Doctrine
Bootstrapping the app
Using Doctrine's Entity Manager
Configuring Doctrine command-line tools
Summary
2. Entities and Mapping Information
Creating the Entity class
Generating getters and setters
Mapping with Doctrine annotations
Knowing about the @Entity annotation
Understanding the @Table, @Index, and @UniqueConstraint annotations
Diving into the @Column annotation
Knowing about the @Id and @GeneratedValue annotations
Using other annotations
Understanding Doctrine Mapping Types
Creating the database schema
Installing Data fixtures
Creating a simple UI
Listing posts
Creating and editing posts
Deleting posts
Summary
3. Associations
Getting started with the Doctrine associations
Understanding the @ManyToOne and @OneToMany annotations with the comment system
Creating the Comment entity class (owning side)
Adding the inverse side to the Post entity class
Updating the database schema
Adding fixtures for the comments
Listing and creating comments
Updating the index
Understanding the @ManyToMany annotation with tags
Creating the Tag entity class (inverse side)
Updating the Post entity class (owning side)
Updating the schema again
Creating tag fixtures
Managing the tags of a post
Summary
4. Building Queries
Understanding DQL
Using the entity repositories
Creating custom entity repositories
Getting started with Query Builder
Filtering by tag
Counting comments
Summary
5. Going Further
Implementing inheritance
Using Mapped Superclasses
Using Single Table Inheritance
Using Class Table Inheritance
Getting started with events
Lifecycle callbacks
Knowing about event listeners and event subscribers
Writing native queries
The NativeQuery class
Doctrine DBAL
Summary
Index
Persistence in PHP with Doctrine ORM
Persistence in PHP with Doctrine ORM
Copyright © 2013 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: December 2013
Production Reference: 1111213
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78216-410-4
www.packtpub.com
Cover Image by Gagandeep Sharma (<er.gagansharma@gmail.com>)
Credits
Author
Kévin Dunglas
Reviewers
Kirill Chebunin
Stefan Kleff
Adam Prager
Chris Woodford
Acquisition Editor
Harsha Bharwani
Lead Technical Editor
Vaibhav Pawar
Technical Editors
Nadeem N. Bagban
Venu Manthena
Sebastian Rodrigues
Copy Editors
Alisha Aranha
Sarang Chari
Deepa Nambiar
Gladson Monteiro
Shambhavi Pai
Kirti Pai
Project Coordinator
Ankita Goenka
Proofreader
Bernadette Watkins
Indexer
Tejal Daruwale
Graphics
Sheetal Aute
Abhinash Sahu
Production Coordinator
Arvindkumar Gupta
Cover Work
Arvindkumar Gupta
About the Author
Kévin Dunglas is the co-founder and CEO of La Coopérative des Tilleuls, a French IT company specializing in e-commerce, owned and managed by its workers themselves. He is also a software architect who works for a lot of companies, including Ubisoft and SensioLabs (creator of Symfony), as an external contractor. He contributes to open source software (especially Symfony, JavaScript, and Ubuntu ecosystems) and has been writing a technical blog for more than 10 years.
About the Reviewers
Kirill Chebunin is a software engineer specializing in server-side web development. His main interests lie in the field of systems with complex background logic. He has been working as the head of a PHP development department, building different enterprises, and billing and analytics systems for the last two years. But his real passion is for open source projects and their communities. Kirill's talks can be found in Russian and Ukrainian PHP conferences, and his commits are presented in Composer, Doctrine, and Symfony projects. You can always see his current interests at Github (https://github.com/chebba) and SlideShare (http://www.slideshare.net/chebba).
Stefan Kleff has been developing web applications for over 12 years at various positions in various companies. He holds degrees from the University of Applied Sciences in Iserlohn, as well as the Hasso Plattner Institute of Computer Science. In a cooperation class with Stanford University, he acquired practical knowledge of Design Thinking. Stefan is an active contributor to the Doctrine project and Zend Framework 2. Currently, he is working as a Project Manager at webXells GmbH and is the co-founder of goalio UG in Potsdam, Germany.
Adam Prager is a full stack web application developer who has created many data-heavy business management applications in the areas of Customer Relationship Management (CRM), Enterprise Resource Planning (ERP), and Laboratory Information Management System (LIMS). He is a big believer in the value and power of open source software, and contributes to projects such as Doctrine and Symfony regularly on Github. He has published numerous Symfony bundles and jQuery plugins of his own. Adam currently works for Netlife in Hungary. Netlife is a Consulting and IT services company, which provides web application development services using the latest technologies, and complete business solutions based on SAP consulting. As a diverse end-to-end IT solutions provider, Netlife offers a range of expertise aimed at assisting customers to compete successfully in the ever changing IT industry. They provide long term solutions with a focus on quality. They have excellent domain expertise in SAP, CRM, custom web application development, and user experience design.
Chris Woodford is a web software consultant and entrepreneur based in Toronto, Canada. He has been working with modern web technologies (Ruby, nodeJS, and PHP) for over 10 years, with a focus on solving tough problems. In his spare time, he co-runs a small record label, Hypaethral Records (http://hypaethralrecords.com) and tours the world with his band TITAN (http://titanslays.com).
www.PacktPub.com
Support files, eBooks, discount offers and more
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.