sfPropelGeneratorExtensionPlugin - 0.1.0

Adds sfMixer hooks to Propel generators

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
Show source

Symfony Propel Generator Extension Plugin

This plugin makes extending Propels generators easier by adding sfMixer hooks to Propel generators. These are added to all functions using the SfExtended* classes.

This plugin was developed for symfony 1.2 and propel 1.3. It will probably work for propel 1.3 under earlier versions of symphony, or even earlier versions of propel, but you may have to regenerate the classes.

Requirements

  • Propel 1.3

Installation

1

In propel.ini, change

; builder settings
propel.builder.peer.class              = plugins.sfPropelPlugin.lib.propel.builder.SfPeerBuilder
propel.builder.object.class            = plugins.sfPropelPlugin.lib.propel.builder.SfObjectBuilder
propel.builder.objectstub.class        = plugins.sfPropelPlugin.lib.propel.builder.SfExtensionObjectBuilder
propel.builder.peerstub.class          = plugins.sfPropelPlugin.lib.propel.builder.SfExtensionPeerBuilder
propel.builder.objectmultiextend.class = plugins.sfPropelPlugin.lib.propel.builder.SfMultiExtendObjectBuilder
propel.builder.mapbuilder.class        = plugins.sfPropelPlugin.lib.propel.builder.SfMapBuilderBuilder

to

; builder settings
propel.builder.peer.class              = plugins.sfPropelGeneratorExtensionPlugin.lib.sfExtendedPeerBuilder
propel.builder.object.class            = plugins.sfPropelGeneratorExtensionPlugin.lib.sfExtendedObjectBuilder
propel.builder.objectstub.class        = plugins.sfPropelGeneratorExtensionPlugin.lib.sfExtendedExtensionObjectBuilder
propel.builder.peerstub.class          = plugins.sfPropelGeneratorExtensionPlugin.lib.sfExtendedExtensionPeerBuilder
propel.builder.objectmultiextend.class = plugins.sfPropelGeneratorExtensionPlugin.lib.sfExtendedMultiExtendObjectBuilder
propel.builder.mapbuilder.class        = plugins.sfPropelGeneratorExtensionPlugin.lib.sfExtendedMapBuilderBuilder

2

Add sfMixer hooks to config/sfExtendedPropelGenerator.conf.php, for example:

function test($object, &$script) { $script .= "/* Comment in all object files */";}
sfMixer::register('SfObjectBuilder:addIncludes:pre', 'test');

will add

/* Comment in all object files */

at the first line of all your Base classes. The call signature of the hooks is the generator object, followed by all parameters of the original function.

For information about available hooks, see the lib/sfExtended* source files.

Generated files

The files in the lib/ directory are autogenerated by tools/generateExtendedClasses.php. This generator reads the original source files and processes all protected function. To get other groups of functions covered, change this file.

Credits

sfPropelGeneratorExtensionPlugin was written by Merlijn van Deen. He can be contacted at valhallasw@gmail.com.