Propel ORM! Cross the relational bridge to the object-oriented wonders!

What is propel?

Propel is a full-service object persistence and query toolkit for PHP. It allows you to access your database using a set of objects, providing a simple API for storing and querying data. You might already have heard of this technique, but under a different name, like Data Access Objects (DAO) or Object Relational Mapping (ORM). It's a port of Apache Torque (see links section below).

What is it good for?

How to get that anyways

How would my code look like?

// example using business objects
$b = new Book();
$b->setTitle("War & Peace");
$b->save();
// "peer" class is static class that handles things like queries
$c = new Criteria();
$c->add(BookPeer::TITLE, "War%", Criteria::LIKE);
$c->setLimit(10);
$books = BookPeer::doSelect($c);
foreach($books as $book) {
  print "
" . $book->getTitle(); }

How do I tell Propel about my database structure

With an XML schema

<?xml version="1.0" encoding="ISO-8859-1"?>
<database name="bookstore">
  <table name="book">
    <column name="book_id" type="INTEGER" required="true" primaryKey="true"/>
	   <column name="title" type="VARCHAR" size="50" required="true" />
  </table>
</database>
</code>

Where i can learn more?