Hello

I'm trying to use a plugin schema with a foreign key that refers to 
another schema table.

In an older thread : we checked that propel-build-* tasks doesn't 
support that kind of schemas.

I found a workaround for that problem :)



Now I'm trying to generate a plugin module with an admin_double_list.
My beginning_class and middle_class are into the plugin schema, and the 
ending_class is into the application schema.

The regular admin_double_list can't handle that because the ending_class 
doesn't have any reference to the plugin classes (due to propel-build-* 
limitations).
I founded out that if I use my own callback function (fourth argument of 
object_admin_double_list function), I can solve this problem.
For that I wrote in my generator.yml :

    edit:
      display: [..., ending_table]
      fields:
        ending_table:
          type: my_admin_double_list
          params:
            ...
            callback: _my_get_propel_object_list

-- I also added getEnding_table function to table class.
-- I also wrote object_my_admin_double_list in 
/plugins/myPlugin/lig/helper/MyObjectAdminHelper

function object_my_admin_double_list ($object, $method, $options = array())
{
  $options = _parse_attributes($options);

  $callback = _get_option($options, 'callback', null);

  return object_admin_double_list($object, $method, $options, $callback);
}

/plugins/myPlugin/lig/helper/MyObjectAdminHelper also defines 
_my_get_propel_object_list function

-- I also added this code to /plugins/myPlugin/config/config.php

$sf_standard_helpers = sfConfig::get('sf_standard_helpers', array());

array_push($sf_standard_helpers, 'MyObjectAdmin');

sfConfig::add(array('sf_standard_helpers' => $sf_standard_helpers));



All that because I couldn't find out how to set callback function of 
regular admin_double_list helper into my generator.yml
(I also didn't find out how to add my helper via generator.yml file, but 
it's another problem).


Problem is : It's quite tricky!

Question is : Did any of you found an easier way to set callback of 
admin_double_list in generator.yml?

 
Any help would be appreciated :-)

Nicolas



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to