== Database ==
The database code in CiviCRM is divided into two logical sections: the DAO and the BAO. The BAO holds the "business logic" for objects and extends the DAO. The DAO is concerned with data to/from the database backend and it's definition (object to relational database mapping, aka "<abbr title="Object-relational Mapping">[[wp:Object-relational mapping|ORM]]</abbr>"). Both are an extension of the [https://pear.php.net/manual/en/package.database.db-dataobject.php PEAR DB DataObject] class. As of August 2015, this is true and [https://civicrm.org/node/95 this blog post from 2006] gives some more (early) background.
<source lang="php">
// from CRM/core/DAO.php