Nobody can help me? please :-(
DavidGot wrote:
>
>
> I have a model named product where I use the translate behavior.
> I just want to translate the Desciption content of a produit
> the code is:
> class Product extends AppModel {
> var $name = 'Product';
> var $actsAs = array('Translate' => array('Description'));
> ?>
>
> This translation is working fine.
>
> Now I have a new model named selection (list of product selected by a
> user):
> the code is:
> class Selection extends AppModel {
> var $name = 'Selection';
> var $actsAs = array('Translate' => array('Description' => 'Product'));
> }
>
> And finaly I have the model named user (user account model)
> the code is:
> class User extends AppModel {
> var $name = 'User';
> var $actsAs = array('Translate' => array('Description' =>
> 'Selection'));
>
> //Liste des selections
> var $hasAndBelongsToMany = array('Selection' =>
>
> array('className' => 'Product',
>
> 'joinTable' => 'selections',
>
> 'foreignKey' => 'user_id',
>
> 'associationForeignKey'=> 'product_id',
>
> 'conditions' => '',
>
> 'order' => '',
>
> 'limit' => '',
>
> 'unique' => true,
>
> 'finderQuery' => '',
>
> 'deleteQuery' => '',
> )
> );
>
> }
> But if I display the list of the user selection I have the error:
> Fatal error: Association Selection is already binded to model User in
> C:\David\perso\cake2\cake\libs\model\behaviors\translate.php on line
> 393
>
> And if I remove the line
> var $actsAs = array('Translate' => array('Description' =>
> 'Selection'));
> All is working expect the Description content.
> all product information is displayed correctly expect the Description
> content.
> For the escription content I faced the following error:
> Undefined index: Description [CORE\app\views\account
> \index_selection.ctp,
>
> What I need to do to have the translation behavior working fine with a
> hasAndBelongsToMany?
>
> Please help me :(
>
>
> >
>
>
--
View this message in context:
http://www.nabble.com/Translate-Behavior-and-hasAndBelongsToMany-not-working-tf4514872.html#a12877847
Sent from the CakePHP mailing list archive at Nabble.com.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---