Tag Archives: data transfer object


Doctrine Repository Hydration, Part 2: Unit Tests

Last time, in the Doctrine ORM Repository Hydration article, we discussed how to use the Doctrine ORM to separate our SQL code into a repository layer. This enabled us to pass a strongly typed DTO to the UI layer as opposed to stringly-typed arrays.

This article will be focused on designing phpunit tests for the previous article. We will focus our efforts on these four repository implementations:

Continue reading →

Doctrine Repository Hydration, Part 1: Solution

With most web applications, there comes a time when your administrative users need reports. These statistics go beyond the typical domain entities and properties that you deal with day-to-day. They consist of aggregate functions (i.e. SUM and MAX) that return numeric scalar values. Lets look at a common MVC solution to expose this data in PHP, and explore how we might refactor that code into something that is maintainable. Our goal is to find the highest quality code that is simple and easy to test.

Continue reading →

All rights reserved