How create a behavior on propel 2

151 Views Asked by At

I installed the following packages on a symfony 2.8 project because I want to upgrade to version 3.4 to take advantage of the LTS

"propel/propel-bundle" : "4.0.x-dev",
"propel/propel" : "2.0.x-dev",

I search how to declare a behavior, before I was on version 1 of Propel, and to declare a behavior, it was enough to do that in the config.yml :

behaviors:
    my_behavior: MyBundle\MyBehavior

The problem is that this configuration does not work anymore with the version 2, I can not find quite precise documentation on how to declare a propel behavior because the goal here is to then use it in the schema.xml like this :

<behavior name="geo_location"></behavior>

The goal is to run : propel:model:build but when I run this command, I get this error message :

Unrecognized option "behaviors" under "propel.database"
1

There are 1 best solutions below

0
On

Have a look at this manual page. Long story short, you have to create a composer package with the type "propel-behavior" to be able to use your behavior in your project.

If you are having trouble, figuring it out, look up some existing behaviors on github to see how it is done.

Examples of cusotm behaviors can be found here.