Hello,
I'm trying to save translated content in model:
class Page extends AppModel {
public $actsAs = array(
'Translate' => array(
'name' => 'nameTranslation'
),
);
public function createRoot($shop_id) {
$data = array(
'shop_id' => $shop_id,
'parent_id' => '',
'name' => array('eng' => 'Root', 'pol' => 'Korzen'),
'active' => 1,
);
return $this->save($data, false);
}
}
And I'm getting error:
Notice (8): Array to string conversion [CORE/cake/libs/model/
datasources/dbo_source.php, line 608
Warning (512): SQL Error: 1054: Unknown column 'Array' in 'field
list' [CORE/cake/libs/model/datasources/dbo_source.php, line 549]
Query: INSERT INTO `pages` (`shop_id`, `parent_id`, `name`, `active`,
`modified`, `created`, `lft`, `rght`) VALUES (30, NULL, Array, 1,
'2009-10-06 17:15:12', '2009-10-06 17:15:12', 3, 4)
Looks like with this line is something wrong:
'name' => array('eng' => 'Root', 'pol' => 'Korzen'),
Any ideas?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---