
Explore what Doctrine is and why to use it, including its database abstraction layer, entities and repositories, annotations, query builders, caching, and framework integrations across databases.
Doug beer outlines his background, detailing his company, programming experience across languages, databases, and operating systems, and his education and global experiences.
Explore doctrine fundamentals, including installation, entities, ORM concepts, repositories, and CRUD operations. Master query builder, performance tuning, caching, and transactions, plus framework integrations with MongoDB and CouchDB.
Set up your computer to run the demo by creating a project folder, copying the file structure, installing doctrine components, configuring data and public folders, and starting the PHP server.
Explore the domain model as a conceptual view of entities, value objects, and their relationships, and how Doctrine uses persist and flush with events.
Learn how DBIL, the database abstraction layer in Doctrine, abstracts underlying database extensions, enabling vendor-agnostic code through the driver manager, prepared statements, transactions, and caching.
Explore object-relational mapping with Doctrine ORM, mapping entities to database tables and covering one-to-one, one-to-many, many-to-many relations, owning and inverse sides, query builder, cascade operations, and transactions.
Define an entity as the mapping between a domain object and a database table, with an ID primary key and support for auto increment and generated value strategies.
Learn how the Doctrine entity manager handles entities and their states, provides access to transactions, and supports find, persist, remove, detach, merge, flush, and various query methods.
A mapper translates between an entity and its database table, and Doctrine supports PHP, XML, YAML, and annotations mappings, demonstrated via ISO country codes and dropdown lookups.
Learn how a repository sits atop the mapping layer to carry out queries, represents an entity, and uses the entity manager with find, find by, and __call.
Explore how lifecycle events govern an entity's creation, updates, and removal, including pre/post persist, pre/post update, and remove, with flush and entity manager interactions.
Set up the lab by creating a lab folder, copying the start structure, and importing data into the suites_complete_lab database, then run php -S localhost:80 -t public to verify.
Set up the lab infrastructure by copying files, creating a database named suite_complete_lab, importing data, and configuring access to tables like members, products, and purchases.
Discover the prerequisites for installing doctrine: a terminal or command prompt, PHP 5.4+, composer with a composer.json, and autoloading setup via PSR-4 namespaces, plus optional symfony/yaml.
Learn what composer is and why you need it. Discover how it installs and updates open source packages, manages dependencies via composer.json, and speeds up PHP project setup.
Install composer on Linux, Unix, or OSX using a terminal from your project root. Run php composer.phar with -d override for allow_url_fopen, then use install or update.
install composer on Windows by opening a command prompt, going to your project root, and running the installer from composer.org via PHP, then use install or update commands.
Learn what a composer.json file is, its directives like name, authors, required, autoloading, and licensing, and how composer reads it to install dependencies into the vendor folder.
Install Doctrine by navigating to your project root, installing composer, creating a composer.json, and running composer install to pull in ORM, DBAL, common libraries and generate autoload files in vendor.
Explore how PHP namespaces prefix class names with backslashes, prevent name collisions, and enable autoloading through use statements, directory structure, and an autoload function.
Explore autoloading in PHP, including the built-in double underscore autoload function, SPL autoload register, and composer autoloader, and how namespaces influence class loading.
Configure your application to use Doctrine by creating entity classes or database tables. Enable composer autoloading, configure Doctrine annotation driver, and initialize the entity manager to perform CRUD via repositories.
Explore the Doctrine command line tool, a shell script linked to the vendor bin Doctrine, and master DBAL, ORM, and mapping capabilities for generating, converting, validating, and updating entities.
Configure the Doctrine command line by enabling the Composer autoloader, setting autoloading, creating the entity manager, and returning a console runner with namespace prefixes, annotation driver, and database parameters.
Install Doctrine using composer by creating or updating composer.json, adding Doctrine requirements, updating composer, and running the install, using the course’s composer database and docs as references.
Learn to install doctrine using composer, fetch the latest version, and run composer install to create the vendor folder with doctrine components and the autoloader.
Configure Doctrine for autoloading and create a base class that builds an entity manager from database parameters in the model file. Test the installation by issuing command line tool commands.
Replace the primitive autoload with a custom Doctrine autoloader and include composer autoloader. Map namespaces, configure the entity manager, and create a base class for Doctrine integration.
Create a Doctrine entity by modeling database data, organize in an application/entity directory, define properties with public getters and setters, and annotate with entity, table, and column tags.
Learn how docblock annotations map PHP entities to database tables using tags like entity, table, and column, define keys and relationships, and leverage lifecycle callbacks and advanced features.
Learn how to define diverse database column types in a Doctrine entity using column annotations, including integers, decimals, strings, dates, arrays, and enums, with schema alignment.
Create a prospects repository by extending the entity repository in the correct namespace and using the entity manager to access find methods such as find by id and find all.
Learn how to use the command line tool, a symbolic link in the vendor bin, to update entities and the database, including mapping generation, schema validation, and updates.
Consult the database schema to identify tables and entities such as members, products, and purchases, then create an entity folder and generate namespaced, autoloaded classes, testing with the entity manager.
Generate Doctrine entities from the database using annotation mapping for members, products, and purchases, then add getters and setters and validate the schema.
Create a repository folder with classes for members, products, and purchases, extending the Doctrine ORM and configuring autoloading, then test by finding the first product and dumping its data.
Learn to create repositories in a Doctrine project, set up a repository directory, extend Doctrine entity repository, enable autoloading, and test with an entity manager.
Create an entity instance, populate it with validated and sanitized data via setters, and do not set the id to ensure an insert. Then persist and flush to save.
Read an entity by obtaining its repository and applying find methods. Use getters to access fields, illustrated with the prospects entity and repository versus entity manager.
Update an entity by obtaining a repository, locating via find one by or find by, updating fields with setters while preserving the id, then persist and flush via entity manager.
Learn to delete an entity in Doctrine by obtaining the repository or using the entity manager to find targets, remove them, and flush, with cascade considerations.
Execute create, read, update, and delete using a database access layer with prospect data. Build forms for create, update, and delete, plus dropdowns and prepared statements.
Learn to build dql queries with the entity manager, bind named parameters, and control hydration modes to return entities, arrays, or scalars, using functions like substring and locate.
Learn to use plain old SQL with Doctrine by creating native and named native queries from the entity manager, and map results with resultset mapping to fetch customer data.
Implement read operations for the member entity in the lab by refactoring the model to use find all and DQL-based counts, enable keyword search, and test via admin login.
Implement read operations on the member entity using the repository and entity manager, including getting all members, counting members, and searching by keyword with a revised query.
Implement create, read, update, and delete operations on a member entity by modifying the members model and view. Persist changes, return the id, and test with admin login and flush.
Learn to implement create, read, update, and delete operations for a member entity using Doctrine, including a hydrate pattern set data method, persist and flush, and repository-driven data handling.
Configure a one-to-one relationship between customer and profile entities in doctrine. Designate customer as the owning (parent) side and profile as the inverse (child), then validate and update the schema.
Configure a one-to-many relationship between entities, designating a parent owning side and a child inverse side with Doctrine mappings using mappedBy, inversedBy, and array collection for the child.
Explore configuring a many-to-many relationship between customers and products in Doctrine, defining the owning side and inverse side, using array collections, and join table mapping.
Learn how to persist customer and profile in a one-to-one relationship, choosing to save parent and child with or without cascade persist, using persist and flush in doctrine.
Update entities in a one-to-one relationship by modifying the owning customer or its profile, then persist and flush with doctrine, leveraging cascade where appropriate.
Learn how to delete entities in a one-to-one relationship with Doctrine: remove the child then the parent and flush, or use cascade remove on the parent to avoid orphaned records.
Learn to persist entities in a one to many relationship by creating a parent and child, setting back links, and using cascade persist to simplify saving.
Update a one-to-many relationship by retrieving the parent, updating the child entity, converting date strings to date time objects, and persisting with flush, using dropdowns to select customer and purchase.
Learn how to delete entities in a one-to-many relationship using Doctrine by removing children, deleting the parent with cascade options, and avoiding orphaned records while balancing control and performance.
Create or locate both customer and product entities, set back links, and persist each with a final flush to establish a many-to-many relationship via a join table.
Learn to update entities in a many-to-many relationship by using the entity manager to persist and flush changes, via the join table and back link.
Delete entities in a many-to-many relationship by removing one side with the entity manager and flush, while handling related one-to-one and one-to-many dependencies and cascade equals remove risks.
Learn to use doctrine with a database view by aliasing columns and joining customer, profile, and purchases, then map the view to an entity and query via a repository.
Backup the database and establish a one-to-many relationship between members and purchases via command line; annotate both entities, then validate, update, and test using Doctrine to link and retrieve purchases.
Explore how to model a one-to-many relationship between members and purchases using Doctrine, including a back link, a cascade option, and an array collection.
Establish a one-to-many relationship between products and purchases, then a many-to-one relation, validating and updating the schema, backing up before changes, and removing obsolete product_id and user_id columns after testing.
Explore establishing a one-to-many relationship between products and purchases in Doctrine, using an array collection on the owning side and updating the schema to reflect the linkage.
Rewrite the purchase process in the database modeling lab by using member and product entities to create a new purchase with back links, persisting via Doctrine and flush for testing.
Rewrite the purchase process in a database model by using members, products, and purchases repositories, creating and linking purchase entities, and performing a test payment in the Paypal sandbox.
Explore Doctrine's two query builders: the ORM builder that generates DQL for entities, and the DBAL builder that produces SQL for arrays, with conditional where clauses and query objects.
Explore how to perform create, read, update, and delete using the dbal query builder, including selecting, inserting, updating, and deleting with positional and named parameters.
Learn to use the ORM query builder from the entity manager to build and execute Doctrine queries with a fluent interface, including select, join, where, group by, and having.
Learn to construct complex database queries using the expression builder from a query builder, combining comparisons, aggregations, arithmetic and string functions into a where clause with placeholders and parameters.
Improve performance of the orm query builder by leveraging caching, indexing, and limit/offset, configure metadata, query, and results caches, and pre-warm the second-level cache to avoid cache slam.
Rewrite get members by keyword using the query builder and test admin search. Rewrite product title and products by title or description, test the dropdown and search with chocolate.
Apply a query builder to implement basic member keyword search and product searches by title or description, using like clauses with a shared parameter and building ordered result sets.
Rewrite get history by id method with the query builder, moving it from members model to purchasers model, then test by admin login to view a member's purchase history.
Implement a Doctrine query builder join to retrieve a member's purchase history in a single query with a single resultset, selecting specific fields from purchases and products.
Explore general doctrine performance tips, including bytecode cache, query cache, and second level cache; leverage fetch modes and partial objects to reduce the unit of work for faster queries.
Configure doctrine DBIL logging to capture performance statistics and queries in microseconds through the echo logger, the debug stack, or a custom kibble logger.
Master doctrine pagination using limit and offset with page tracking. Compare query builder and doctrine query language paginate with first result and max results for items per page.
Improve performance by caching expensive outputs and serving future requests from cache. Explore doctrine cache drivers such as APC, Memcached, file system, and MongoDB, with cache keys and fetch/save.
Explore how proxies wrap entity getters to enable lazy loading, boosting performance by loading related data only when requested, and learn how to generate them with Doctrine.
Learn how to use the doctrine event manager to register listeners and subscribers, dispatch events with optional event args, and build asynchronous messaging that decouples logic.
Learn how to use Doctrine lifecycle callbacks and life cycle events to automate maintenance tasks like setting created and last updated fields, by using annotations, entity listeners, or event listeners.
Master doctrine filters by building a level filter class with add filter constraint logic, enabling automatic where clauses and level based access for admins and customers.
Learn how doctrine's second level cache uses named regions to cache entities, collections, and queries, with read-only and read-write modes for safe and fast data access.
Explore how Doctrine uses the entity manager to wrap insert, update, and delete in atomic, consistent, isolated, and durable transactions, with automatic begin and commit and rollback on errors.
Explore how Doctrine inheritance mapping works, including mapped superclasses, single table and class table inheritance, discriminator maps, and association overrides to share properties across entities.
This lecture covers doctrine security and the risks of eske fuel injection, showing how prepared statements and set parameter protect queries, with input validation and safe expression usage.
Uncover known doctrine limitations and issues, including relationships, caching, date time handling, lifecycle events, and doctrine query language nuances.
Implement pagination in the performance tuning lab by revising get all members with an or query builder using limit and offset, and use Doctrine query language to paginate products.
Explore the lab solution for performance tuning by implementing pagination with Doctrine query language and query builder. Learn offset and max results to page members and products in admin view.
Set up proxies and enable on-demand generation by configuring the proxy directory and general config, test with the entity manager, and use the command line tool.
Review the proxies and file system cache solution, focusing on the init class, proxy directory, parameter overrides, and the default cache lifetime for query, metadata, and output caches.
Implement a lifecycle callback by adding a last updated DateTime property with a getter and setter, update the schema, and test updates via admin login.
Implement a lifecycle callback on the members entity to automatically update the last updated timestamp when changes occur, and update the database schema accordingly.
Configure Zend Framework 2 with Doctrine via composer and local overrides; set up the entity manager and repositories, define entity classes with form annotations, and test using the PHP server.
demonstrate how doctrine works with the symphony framework, showing yaml-based configuration, entity definitions, repositories, and forms to create, search, update, and delete prospects in a demo app.
learn how to integrate doctrine with CodeIgniter by installing Composer, configuring database parameters, setting up autoloading, and building a Doctrine library, entity manager, and repositories within a CodeIgniter project.
Explore the Doctrine ORM module for Zend Framework 2, leveraging service manager keys, authentication integration, Doctrine entities, and pagination to build and query repositories with form elements.
Explore MongoDB, a distributed, schema-less no-sql database designed for cloud environments. Identify how distributed writes, primary and secondary replicas, journaling, and query planning enable scalable, reliable operations.
Configure doctrine with MongoDB by updating the composer file, enable autoloading for the doctrine namespaces, and obtain a document manager to access collections via document classes.
Configure document classes with Doctrine ODM annotations to enable CRUD in MongoDB. Show repository and document manager workflows and query builder usage for finding, creating, updating, and deleting prospect documents.
In this Learning Doctrine training course, expert author Doug Bierer will teach you how to install and configure Doctrine for any PHP project. This course is designed for users that already have experience with PHP.
You will start by learning concepts and terms, then jump into installing Doctrine. From there, Doug teaches you how to create entities, perform create, read, update, and delete operations, and model a database. This video tutorial also covers the query builder, performance tuning, and incorporating Doctrine into frameworks. Finally, you will learn how to configure apps to use Doctrine with MongoDB and CouchDB.
Once you have completed this computer based training course, you will be fully capable of working with Doctrine to model database tables using entities, perform create, read, update and delete operations, build queries, and much more. A substantial number of working files are included, allowing you to follow along with the author throughout the lessons.