Super Lightweight
- Make development easy without getting in the way – Only include required base functionality to make development easier without trying to do everything
- NO generated code- All models and data are dynamic, not repetitive static copies of the same code
Ultra Portable
- NO Dependencies outside PHP5.2
- NO Dependencies on other code packages or frameworks (not even PEAR)
- Can be used in any project, anytime
Follow Standards
- PHP5.2+ code ONLY, PHP4 is NOT supported
- Use Zend Coding Standards and Zend Naming Conventions for everything
Be Easy to Use and Understand
- Simple, clear syntax that fits with the PHP style
- Minimal code with maximum impact
- Can work with any table by extending from base mapper (phpDataMapper_Model)
- Eliminate the need for custom SQL queries in most cases
- Still allow custom SQL when required
- Enable full automation whenever possible (retrieving and saving table relations, etc)
Model-Driven, not Database-Driven
- Model drives the database
- Tables and fields must be defined in the mapper, not automatically retrieved from the database
- Enables easier table structure updates and migrations
- Allows table and column changes in one place – your code
Follow True Definition of a Data Mapper
- Keep mapper and row objects independent of the database and each other (Martin Fowler)
- Row objects are as “dumb” as possible, with no knowledge of the mapper
- $mapper->save($row), not $row->save() – Row objects are not supposed to know about the mapper
No Special Rules or “Magic”
- No automatic discovery of table names or fields
- No table or column naming schemes for table relations
- Relations, tables, and fields must be configured and specified in the mappers
- Allows phpDataMapper to be used on existing projects and table structures without any modifications to your data, columns, or table structure