There is no delegate behavior in sfPropelORMPlugin #164

Closed
mmonguilod opened this Issue Oct 2, 2012 · 4 comments

Projects

None yet

2 participants

@mmonguilod
Contributor

As far as I know, the delegate behavior is build in propel, but not ins the integration with symfony 1.4.

There is any guide to build a behaviour for symfony 1.4?

I need this behaviour and if it's not too difficult I can code the symfony part.

@willdurand
Member

All Propel behaviors work fine in symfony 1.4. What did you expect?

@mmonguilod
Contributor

Sorry for not to have explained correctly the problem. The problem is related to propel-diff executed from symfony 1.4. When i make a propel:diff I get the following error in red:

Unknown behavior "delegate"; make sure you configured the propel.behavior.delegate.class setting in your build.properties

Looking at the code, It seems that the delegate behavior is not defined in /lib/task/sfPropelBaseTask.class.php. I defined it in the function getGeneratorConfig:

    $behaviorsMapping = array(
      'timestampable' => 'TimestampableBehavior',
      'alternative_coding_standards' => 'AlternativeCodingStandardsBehavior',
      'soft_delete' => 'SoftDeleteBehavior',
      'auto_add_pk' => 'AutoAddPkBehavior',
      'nested_set' => 'nestedset.NestedSetBehavior',
      'sortable' => 'sortable.SortableBehavior',
      'delegate' => 'DelegateBehavior',
      'sluggable' => 'sluggable.SluggableBehavior',
      'concrete_inheritance' => 'concrete_inheritance.ConcreteInheritanceBehavior',
      'query_cache' => 'query_cache.QueryCacheBehavior',
      'aggregate_column' => 'aggregate_column.AggregateColumnBehavior',
      'versionable' => 'versionable.VersionableBehavior',
      'i18n' => 'i18n.I18nBehavior',
    );

Now, propel-diff works as expected.

As you can see I only added the line:

      'sortable' => 'sortable.SortableBehavior',

I can prepare a pull request if you want.

@willdurand
Member

Yes please, write a Pull Request. I'd be glad to merge it!

On Wed, Oct 3, 2012 at 10:02 AM, Manel Monguilod
notifications@github.comwrote:

Sorry for not to have explained correctly the problem. The problem is
related to propel-diff executed from symfony 1.4. When i make a propel:diff
I get the following error in red:

Unknown behavior "delegate"; make sure you configured the
propel.behavior.delegate.class setting in your build.properties

Looking at the code, It seems that the delegate behavior is not defined in
/lib/task/sfPropelBaseTask.class.php. I defined it in the function
getGeneratorConfig:

$behaviorsMapping = array(
  'timestampable' => 'TimestampableBehavior',
  'alternative_coding_standards' => 'AlternativeCodingStandardsBehavior',
  'soft_delete' => 'SoftDeleteBehavior',
  'auto_add_pk' => 'AutoAddPkBehavior',
  'nested_set' => 'nestedset.NestedSetBehavior',
  'sortable' => 'sortable.SortableBehavior',
  'delegate' => 'DelegateBehavior',
  'sluggable' => 'sluggable.SluggableBehavior',
  'concrete_inheritance' => 'concrete_inheritance.ConcreteInheritanceBehavior',
  'query_cache' => 'query_cache.QueryCacheBehavior',
  'aggregate_column' => 'aggregate_column.AggregateColumnBehavior',
  'versionable' => 'versionable.VersionableBehavior',
  'i18n' => 'i18n.I18nBehavior',
);

Now, propel-diff works as expected.

As you can see I only added the line:

  'sortable' => 'sortable.SortableBehavior',

I can prepare a pull request if you want.


Reply to this email directly or view it on GitHubhttps://github.com/propelorm/sfPropelORMPlugin/issues/164#issuecomment-9098581.

@mmonguilod
Contributor

@willdurand The pull request is in the queue.

@mmonguilod mmonguilod closed this Oct 7, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment