Mam problem z automatycznym tworzeniem zapytań do bazy w cake php.
Gdy jako argument funkcji podaję 0 to zapytanie przekształca tą wartość na NULL.
Korzystam z behaviora Translate oraz Tree i problem występuje w generowanych przez niego zapytaniach.
Kod pobierający wpisy o danym parent_id
Wygenerowane zapytanie SQL
SELECT `Page`.* AS `Page__*`, `I18n__name`.`content` AS `I18n__name__content`, `I18n__content`.`content` AS `I18n__content__content` FROM `pages` AS `Page` LEFT JOIN `i18n` AS `I18n__name` ON (`Page`.`id` = `I18n__name`.`foreign_key` AND `I18n__name`.`model` = 'Page' AND `I18n__name`.`field` = 'name') LEFT JOIN `i18n` AS `I18n__content` ON (`Page`.`id` = `I18n__content`.`foreign_key` AND `I18n__content`.`model` = 'Page' AND `I18n__content`.`field` = 'content') WHERE 1 = 1 AND [b]`Page`.`parent_id` IS NULL[/b] AND `I18n__name`.`locale` = 'pol' AND `I18n__content`.`locale` = 'pol' ORDER BY `Page`.`lft` ASC
Czy wie ktoś jak sobie poradzić z tym zachowaniem?