Hi all... Here is my problem : I have to manage members of a website. those members have a "member_type" (like customer, visitor,... for example) they have also some speciality (3 speciality by member)
AND for type and specility, we want to use i18n to internationalyse it... here is a part of my schema.yml file : membre: _attributes: { phpName: Membre } id: [...] membre_type_id: { type: integer, default: 1, primaryKey: false, foreignTable: membre_type, foreignReference: id, required: true } [...] specialite1: { type: integer, primaryKey: false, foreignTable: membre_specialite, foreignReference: id, required: true } specialite2: { type: integer, primaryKey: false, foreignTable: membre_specialite, foreignReference: id, required: true } specialite3: { type: integer, primaryKey: false, foreignTable: membre_specialite, foreignReference: id, required: true } membre_type: _attributes: { phpName: MembreType } id: membre_type_i18n: _attributes: { phpName: MembreTypeI18n } libelle: { type: varchar(64) } membre_specialite: _attributes: { phpName: MembreSpecialite } id: membre_specialite_i18n: _attributes: { phpName: MembreSpecialiteI18n } libelle: The problem is very simple : we want to make a list of all the members to see all of them , and when we clic on one of them, we can edit it. All is OK for the membre_type -> the name of the type is print on the list AND on the edition page (in a listBox if we want to change it) BUT for the speciality, it's good for the edition page (in listBox) but it does'nt work in the list page : only the id (1, 2, ...) is print instead of the name of this one (nameOfTheSpecility1, ...) To print the name of the membre_type or membre_speciality, we use fonction __toString() : MembreType.php : public function __toString() { $c = new Criteria(); $c -> add(MembreTypePeer::ID, $this->getId()); $result = MembreTypePeer::doSelectWithI18n($c); return $result[0] -> getLibelle(); } MembreSpecialite.php : public function __toString() { $c = new Criteria(); $c -> add(MembreSpecialitePeer::ID, $this->getId()); $result = MembreSpecialitePeer::doSelectWithI18n($c); return $result[0] -> getLibelle(); } The problem is... for the membre_type (list and edit) the __toString() function is call... but for the membre_speciality, only the edit module calls the function. When the list is created, the module don't call the __toString() function... and the id is print instead of the name... Why did it works for the membre_type and the edition of membre_speciality but not for listing ?? LIST MODE : (lien vers une image) http://fileshosting.free.fr/FILES/MWO9ozFg1dW6xHCipWYwmVjPI5FUA3UbHxOHgwRDcA3WoVxJ17FO5ocFAHv2nR6dIa5ksBl0IwNLKHbiL7iNKHgP14.png EDIT MODE : (lien vers une image) http://fileshosting.free.fr/FILES/Z9KTBZKg21dIVdKNvae0rnzJnGTkGQMcD8K7huPjbJsv1EpHvXvAA9phtKQnofkXIDCX3QfM18CpKOQQoKHyIgRCwU.png Who can help me???? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---