I am using containable behavior in Cake 2.4. I have 2 tables - Page and Page_ Translated I have many page_translations in page I
Since the page can be in different languages, there are only numbers in the page table (id, data, image, act). Page_translated has its own ID, Page_ID, Name, Slug, Locale, Description Act.
My problem is that I have only data that can be specifically chosen from page_translated (combination of slug and locale). If I had to type a different query to choose a translation of page_ID form pages by specifying the slip and locale, I would get 1 result. Then I'll search from that page_id in the table of pages and get a result again. I want to get it in 1 query. Is this also possible? Whenever I put a query in the cake without unconditional on the main table, it always says:
pages_translated from WHERE pages_translated .locale = eng and pages_translated.slug = 'Www.mypage.com' and pages_translated.page_id` = (1)
in the last part where page_ id = 1 breaks everything, but I think the cake keeps it there To make sure that only 1 row is selected, how can I direct it, so this final statement O writes?
No comments:
Post a Comment