Jochen's work of the last months finally landed into Extbase trunk: The complete rewrite of the persistence layer! It is now even closer to the FLOW3 architecture, implementing the same query language as FLOW3.
For you as a programmer, this mostly means that you do not have to write a single line of SQL anymore - a great benefit in terms of security - no SQL injections possible anymore!
Most SQL queries in today's web applications are things like "SELECT * FROM users WHERE username='john'" - these are even easier by using the magic methods provided in every repository. To get the User object with username "john" you can do the following in your controller:
$user = $this->userRepository->findOneByName('john');
// $user is a user object now!
Pay special attention to the naming of the finder method. You always have findBy* and findOneBy* methods available on every repository for all properties. Additionally, you get back an object! Thus, no fiddling with arrays and the like anymore!
Now, you might ask yourself how you can write more complex queries. They are placed inside the repository class, and can look like this:
$query = $this->createQuery();
$resultingUser = $query->matching(
$query->logicalAnd(
$query->equals('username', $username),
$query->equals('password', $password)
))->execute();
It takes some time to get accustomed to the above syntax, but it is the same syntax as in FLOW3! You will not notice if a relational database or a content repository is queried. Isn't that cool?
Lazy Loading
Actually, you might wonder if it is worth it to have such complex code changes for so little things which change on the surface. However, we definitely think yes: Because of the new, clean architecture of the persistence layer, Jochen has been implementing Lazy Loading and some other neat features already.
Next steps
We are currently reviewing the code, and fixing issues, and then update the version in TYPO3 trunk. If you want to play around with it, you can find the bleeding edge in the SVN.
Please give us some feedback!