Skip to Content (c) Skip to Navigation (n) Skip to Search (s)

1.0-beta (rev 75) released!

xPDO is in beta. There are several API improvements, more code reductions and simplifications, and the introduction of SQLite and PostgreSQL driver support are coming very soon. xPDO is being used to develop the next-generation MODx CMF.

Forgotten credits...

I'd like to extend a special thanks to Andrea Giammarchi for his PDO for PHP 4 implementation that inspired me to begin coding this project. If not for PHPClasses.org and the inspiration I found in Andrea's work there, the OpenExpedio project would likely not exist, as I probably would have invested my time in working with PHPDoctrine.

Some important changes are coming in the 1.0 beta release

Aliases for Related Objects

In previous releases of xPDO, in order to distinguish multiple unique relations to the same foreign class from another class, you were required to define a key attribute and use that key throughout the API. In order to simplify the aggregate and composite relations implementation, xPDO 1.0 beta introduces a new attribute for these schema elements called alias, by which you can refer to the related class in the API. This means there will be some significant changes to any existing calls to a few of the methods for accessing related objects, e.g. getOne(), getMany(), addOne(), addMany(), and some of the new API calls associated with xPDOQuery that appeared in the more recent SVN versions of 1.0 alpha (trunk).

xPDOQuery

An extension of xPDOCriteria that can be used to build SQL statements using convenient PHP APIs. By providing implementations of xPDOQuery for each database platform, it can serve as an optional high-performance SQL abstraction layer to make it even easier to build your complex business logic on top of your xPDO-generated scaffolding.

Object Graphs

Object graphs are just a fancy way of describing a set of related objects. Several new methods on the xPDO class allow you to pass object graphs parameters (in PHP array or JSON formats) to build single queries to populate an entire graph of related objects in a single query. xPDOQuery offers additional methods to manually build queries using object graphs.

Hydrating object variables

In order to emulate properties being stored directly on the objects as most PHP object models provide, you can now optionally hydrate persistent database fields and/or related objects as object variables on your xPDO-generated classes. This makes your xPDO-generated models the perfect companion for the Smarty template engine, or other frameworks that can utilize instances of your classes (a.k.a. objects) and expect the object variables to be accessible in this manner.