Monday, December 17, 2012

Translate on BelongsToMany

Dear coders

I have an issue on a project That I am working, I have to models linked
on a belongsToMany relationship, and both of them are using the
translate behavior

i18n -> SubCategory [ belongsToMany ] Category <- i18n

Then I need to do a list like

CategryName - SubCategoryName

As you could see I need to concatenate Name field on both models, and
name field on both models are translated, I mean, both of them name
fields are on the i18n table, then when I do a

$this->Subcategory->find ('all');

for process and user the fields needed, I could see that Categroy,
doesnt have the Name field, just Subcategory has the name field

Any suggest

Best Regards


--
Carlos Eduardo Sotelo Pinto
GNU Linux Admin | PHP Senior Web Developer
MObil: RPC (Claro)+51, 958194614
http://www.carlossotelo.com
Skype: csotelop
Yahoo: csotelop
MSN: carlos.sotelo.pinto@gmail.com
GTalk: carlos.sotelo.pinto@gmail.com
GPG FP:697E FAB8 8E83 1D60 BBFB 2264 9E3D 5761 F855 4F6B
GNULinux RU #379182 || GNULinux RM #277661

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.

No comments: