chrispie
unread,Oct 12, 2009, 8:22:43 AM10/12/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to CakePHP-de für deutsche CakePHP Entwickler
Hallo! Ich versuche momentan eine Suche mit LIKE auf ein Model mit
i18n (übersetztes Feld: Name) zu machen.
mein query:
$this->City->find('all', array('conditions' => array('name LIKE' =>
$this->params['url']['q'].'%' ), 'fields' => array('id','Name')
generiert:
SELECT `City`.`id`, `City`.`Name` FROM `cities` AS `City` WHERE
`name` LIKE 'aac%'
-> nichts zu sehen von i18n! was mache ich falsch?
mein normaler find('all') generiert hingegen richtig:
SELECT `City`.*, `I18n__name`.`content`, `City`.`id` FROM `cities` AS
`City` LEFT JOIN `i18n` AS `I18n__name` ON (`City`.`id` =
`I18n__name`.`foreign_key` AND `I18n__name`.`model` = 'City' AND
`I18n__name`.`field` = 'name') WHERE `I18n__name`.`locale` = 'deu'
LIMIT 20
Vielen Dank !