Hi,
I do not understand why the following code does not work properly.
I need help.
I use this Model Class :
class Product extends AppModel
{
var $name = 'Product';
var $hasOne = array(
'Post' =>
array('className' => 'Post',
'dependent' => true,
'foreignKey' => 'product_id')
);
}
And I I'd like to apply translation on this Model :
class Post extends AppModel
{
var $name = 'Post';
var $actsAs = array('Translate' => array(
'body' => 'TranslationPostBody'));
var $hasMany = array('Comment' =>
array(
'className' => 'Comment',
'conditions' => '',//Comment.moderated = 1',
'order' => 'Comment.created DESC',
'limit' => '5',
'foreignKey' => 'post_id',
'dependent' => true,
'exclusive' => false,
'finderQuery' => '',
'fields' => '',
'offset' => '',
'counterQuery' => ''
));
}
My Post.body data are well stored in database, in my i18n table.
But I can't get this data doing like that in my ProductsController
class:
$this->Product->id = $id;
$product = $this->Product->read();
$product['Post']['body'] is empty.
Why ? Any idea ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---