Users/Introduction

An Introduction to Propel

As mentioned on the Home Page, Propel is an object persistence layer. To you as a software developer, this means that you won't have to deal with SQL statements and database connections anymore. Instead, you are using Classes and Objects to access your data in a very smart and convenient way. Below is an example which gets a book from the database, changes the book's title, and then saves it again:

$book = BookPeer::retrieveByPK(5);
$book->setTitle('The Propel Story');
$book->save();

You simply have to define the structure of your database in an XML file and let Propel do the rest. It will generate all classes for you, and even the .sql database schema definition. This allows you to benefit from exciting features - including an emulation of Foreign Keys even on RDBMS that do not natively support them! At all times, you have full control over what is happening to your data thanks to Propels high extensibility.

Here's a sample visualization of where Propel fits with respect to the your PHP application, the database, and to Creole (see Technology). Note that the top-level is supposed to represent any PHP application, and most likely will consist of several additional layers.

Architecture Diagram

Still not convinced? Read Why Propel? for more reasons to give Propel a chance or have a look at more of its Features!

Attachments