Introduction
Objectiphy is a simple data mapper ORM - inspired by (and somewhat compatible with) the Doctrine project, with the aim of being easy to learn, intuitive, and flexible.
Create repositories using the repository factory:
You can use simple criteria in an array to load entities:
Or use more complex criteria to limit which properties of which records are returned using the object-oriented query builder, which closely resembles standard SQL syntax (but using classes and properties instead of tables and columns):
Inserting or updating entities is also very easy (Objectiphy keeps track of changes to entities that it loaded, so will only save the things that have changed):
Mapping information is typically specified using mapping definitions. You can use entities with Objectiphy or Doctrine attributes or annotations (some features of Objectiphy that are not present in Doctrine require Objectiphy attributes, but you can mix both types).
Features
one-to-one, many-to-one, one-to-many, and many-to-many relationships
lazy or eager loading
filter based on properties of both parent and child objects (even one-to-many)
filter using complex criteria
easily write custom queries
iterable results for streaming
option of fetching unbound (scalar) results
limit hydration using serialization groups
automatic or manual control of transactions
embedded value objects
perform scalar joins (retrieve a single value from a joined table without needing a new entity or custom query)
use aggregate functions to populate properties or as filter criteria
use any MySQL function you like in custom queries
mark properties as read only
manually override mapping definitions (useful for unit testing)
custom collection classes (for collections of child objects)
handles recursive object relationships
This library has the ability to insert, update, and delete records in your database. Use with care!
Last updated