Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Symfony]i18n i kategorie
trucksweb
post
Post #1





Grupa: Zarejestrowani
Postów: 1 199
Pomógł: 31
Dołączył: 22.03.2004
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


mam problem bo juz nie wiem w czym szukac.

Robilem wczesniej wielojezykowy projekt i wydaje mi sie, ze tak samo przeprowadzilem obecnie procedure:
mam tabele:
category (klucz glowny na id_cat)
category_i18n (klucz glowny na id_cat i culture)

robie teraz zapytanie:

  1. $c = new Criteria();
  2. $c->addAscendingOrderByColumn(CategoryPeer::ID_PARENT);
  3. $c->addJoin(CategoryI18nPeer::ID_CATEGORY, CategoryPeer::ID_CATEGORY);
  4. $c->add(CategoryI18nPeer::CULTURE, 'pl_PL');
  5. $categories = CategoryPeer::doSelect($c);


potrzebuje tego tylko tlumaczenia polskiego do spisu na poziomie admina.

teraz w szablonie:
  1. foreach($categories as $cat)
  2. echo $cat->getName()


wywala blad:
Cytat
Call to undefined method BaseCategory::getName



czemu?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
trucksweb
post
Post #2





Grupa: Zarejestrowani
Postów: 1 199
Pomógł: 31
Dołączył: 22.03.2004
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


opisalem co sie znjaduje w tabelach ale jak to tak potrzebne to prosze:

  1. category:
  2. _attributes:
  3. idMethod: native
  4. isI18n: true
  5. i18nTable: category_i18n
  6. id_category:
  7. type: INTEGER
  8. required: true
  9. autoIncrement: true
  10. primaryKey: true
  11. id_parent:
  12. type: INTEGER
  13. required: false
  14. unsigned: true
  15. foreignTable: category
  16. foreignReference: id_category
  17. onDelete: RESTRICT
  18. onUpdate: RESTRICT
  19. ip:
  20. type: VARCHAR
  21. size: 1024
  22. required: false
  23. depth:
  24. type: INTEGER
  25. required: false
  26. description:
  27. type: VARCHAR
  28. size: 4096
  29. created_at: { type: timestamp }
  30. updated_at: { type: timestamp }
  31.  
  32. category_i18n:
  33. _attributes:
  34. idMethod: native
  35. id_category:
  36. type: INTEGER
  37. required: true
  38. primaryKey: true
  39. foreignTable: category
  40. foreignReference: id_category
  41. culture:
  42. isCulture: true
  43. type: VARCHAR
  44. size: 7
  45. required: true
  46. primaryKey: true
  47. name:
  48. type: VARCHAR
  49. size: 1024
  50. required: true
  51. seo_name:
  52. type: VARCHAR
  53. size: 1024
  54. required: true


Ten post edytował trucksweb 28.06.2010, 18:06:09
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 18.10.2025 - 05:00