The SitePoint PHP blog has posted a new tutorial focusing on the Atlas ORM, a recent addition to the wide range of database ORMs in the PHP ecosystem, focusing on being a mapping of your persistence model.
By definition, a Data Mapper moves data between objects and a database and isolates them from one another. With a Data Mapper, the in memory objects don’t even need to know that a database exists. It does not need to know the SQL interface or database schema; it doesn’t even need the domain layer to know it exists!This might lead us to thinking that, in Atlas, the persistence layer is totally disconnected from the database, but that is not quite what happens. [...] An Atlas Record is passive; not an active record. Unlike most ORMs, its objects represent the persistence model, not the domain model. Think of it as representing how the data is stored and not as real world representations.
The tutorial goes on to talk about some of the background behind the package being developed and some of its core principles. They then walk you through the installation of the package, doing a bit of related database setup and the code to perform some basic CRUD (create, read, update, delete) operations on the tables. This is followed by a few more practical examples and a few caveats for the library's use.