Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Propel Behavior to customize generated Base classes extension
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
doc add graphic schema
tests add unit test
.gitignore add unit test
.travis.yml Revert "fix php version in travis"
LICENSE add MIT license update README
composer.json add unit test
composer.lock add unit test
phpunit.xml.dist add unit test


Build Status


MIT License

copyright (c) 2012 Charles Sanquer


Propel Behavior to customize generated Parent Base classes

The normal propel inheritance with generated base classes follow this schema :

Normal inheritance schema

With CustomBaseBehavior you can change the parent classes of the base generated classes and share common methods between model objects

Customized inheritance schema


This behavior requires Propel >=1.6.0


You can use composer and package csanquer/custom-base-behavior

Or just download and copy the behavior to a specific path.

Then register the behavior class by adding the following to the bottom of the file in you project folder:

# check that you have behaviors enabled
propel.builder.addBehaviors = true

# and add the custom behavior
propel.behavior.custom_base.class =

Enable the behavior in your schema.xml:

<table name="book">
  <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
  <column name="title" type="VARCHAR" required="true" />

  <behavior name="custom_base">
    <parameter name="base_object" value="MyCustomBaseObject" /> <!-- default = "BaseObject" -->
    <parameter name="base_peer" value="MyCustomBasePeer" />     <!-- default = "" -->
    <parameter name="base_query" value="MyCustomBaseQuery" />   <!-- default = "ModelCriteria" -->

Base classes can use namespaces ( with \, / or dot character).

Your custom Base Object class should extend Propel BaseObject and your custom Base Query class should extend Propel ModelCriteria.


To run tests

curl -s | php
php composer.phar --dev install
Something went wrong with that request. Please try again.