Hi,
I used propel for orm engine.
But I got big problem with multiple primary keys in admin generator.
I found a solution. ->
http://tohenk.wordpress.com/2009/04/22/using-multiple-primary-keys-in-admin-generator/
But It does not perfectly solve routing problems.
In auto generated partial template:
_list_td_batch_actions.php
It use "<?php echo $YourModel->getPrimaryKey() ?>" to get primary
key.
But in this case,it returns an array not a string.
So,I have to do some hard code to overidle getPrimaryKey method like
this.
public function getPrimaryKey(){
return implode('-',parent::getPrimaryKey());
}
and output will like this "xxx-xxxx"
But in another case, while I defined an extend actions in
generator.yml (object_actions)
auto generated partial template:
_list_actions.php
<?php echo $this->addCredentialCondition($this->getLinkToAction($name,
$params, false), $params)."\n" ?>
It Wiil call sfModelGenerator::getLinkToAction() to generate url
But It dos not using Model's getPrimaryKey() to get primary keys.
It calls $this->getPrimaryKeyUrlParams() to get primary keys .
The result will like this. -> "pk1=xxx&pk2=xxx"
this will cause 'link_to' helper to generate wrong url.
So....
Can we add a new param in generator.yml
multiple_pk_seprator: '-'
and do some modify
1. lib/generator/sfModelGenerator.class.php
modify getPrimaryKeyUrlParams() add multiple pk detect in admin
generator.
2. modify admin generator task to auto generate routing.yml with
multiple pk support
3. modify lib/plugins/sfPropelPlugin/data/generator/sfPropelModule/
admin/template/templates/*
or any one have another good ideas?
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" 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-devs?hl=en