A highly customizeable and blazing fast ORM library for PHP 5.4+.

Fast

Thanks to the code generation we reach very fast execution times.

Migration

Supports schema migration for MySQL, SQLite and PostgreSQL.

Reverse Engineering

For existing database structures we support reverse enginering of your current database schema.

IDE friendly

Propel generates all of your getter and setter as well as filter, relation methods and much more for you.

Customizable

Through our configuration system you can adjust almost all gears.

High Quality

Test-Driven-Development, Unit-Tests, Continuous-Integration and Code-Coverage over 94% show our quaility.

Open Source

Propel is available under the open-source MIT license.

Community

The Propel project started in 2005, has over 10k users each month and powers thousands of websites.

Well documented

Oh, and we have a pretty detailed documentation!

Installation

Via Composer

"require": {
    "propel/propel": "~2.0@dev"
}

All releases at packagist.org: packagist.org/packages/propel/propel

All releases at github.com: github.com/propelorm/Propel2/releases

Propel Build Status

Propel is strongly unit tested and is developed under Continuous Integration with a Test Driven Development approach.

We use Travis-CI to automatically build our projects, and here are the statuses:

Propel 1.7
Propel2
sfPropelORMPlugin
PropelBundle
PropelServiceProvider

Dive In!

What is Propel exactly?

Propel is an open-source Object-Relational Mapping (ORM) for SQL-Databases in PHP 5.4. It allows you to access your database using a set of objects, providing a simple API for storing and retrieving data.

Additional to its ORM capabilities it does provide a query-builder, database schema migration, reverse engineering of existing database and much more.

Why Propel?

Propel gives you, the web application developer, the tools to work with databases in the same way you work with other classes and objects in PHP without writing SQL.

  • Propel is blazing fast
  • Query-Builder
  • IDE friendly thanks to code-generation
  • Generation of methods for all columns and relations
  • Database schema migration
  • Schema reverse engineering
  • Customizable
  • Well documented
  • Propel comes with common 'behaviors'

How?

You need to write the definition of your tables as xml, export it from your existing database through our 'database:reverse' command or build it via a tool like ORM-Designer.

<?xml version="1.0" encoding="UTF-8"?>
<database name="bookstore" defaultIdMethod="native">
  <table name="book" phpName="Book">
    <column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true"/>
    <column name="title" type="varchar" size="255" required="true" />
    <column name="isbn" type="varchar" size="24" required="true" phpName="ISBN"/>
    <column name="author_id" type="integer" required="true"/>
    <foreign-key foreignTable="author">
      <reference local="author_id" foreign="id"/>
    </foreign-key>
  </table>
  <table name="author" phpName="Author">
    <column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true"/>
    <column name="first_name" type="varchar" size="128" required="true"/>
    <column name="last_name" type="varchar" size="128" required="true"/>
  </table>
</database>

More details please!

It uses PDO as an abstraction layer and code generation to remove the burden of runtime introspection to achieve the fast execution time.

Propel implements all the key concepts of mature ORM layers: the ActiveRecord pattern, validators, behaviors, table inheritance, reverse engineering an existing database, nested sets, nested transactions, lazy loading, LOB, you name it.

Propel is built for developers who need to keep control of their code:

  • Extensibility is at the heart of Propel's design; whatever you need to customize, Propel allows you to do so in a snap.
  • Propel can get out of your way for when you need custom queries or hyper-optimized transactions.
  • If you need to change your RDBMS in the course of the project, rebuild your model and you're ready to go. Propel supports MySQL, PostgreSQL, SQLite, MSSQL, and Oracle. First three are completely integrated in our test suite.
  • The code generated by Propel is well commented, IDE-friendly and easy to use.
  • The Propel project started in 2005 and already powers thousands of websites. Thoroughly documented, backed by many tutorials across the web, it also benefits from an enthusiast community that provides rapid support for both beginner and hardcore developers.

Propel is released under the MIT license. It's free to use, even in commercial applications.

Do you want to know more? Jump to the Documentation tab, or start exploring the code in the GitHub repository.