My code:

class Product extends AppModel {
        var $name = 'Product';
        var $actsAs = array(
                'Translate' => array(
                        'name'));
        var $belongsTo = array(
                'Category' => array(
                        'className' => 'Category',
                        'foreignKey' => 'category_id'));
}

class Category extends AppModel {
        var $name = 'Category';
        var $actsAs = array(
                'Translate' => array(
                        'name'));
        var $hasMany = array(
                'Product' => array(
                        'className' => 'Product',
                        'foreignKey' => 'category_id',
                        'dependent' => false));
}

I drops fields 'name' from tables products and categories and when I
want read my product: $this->Product->findById($id), I get results
like this:

Array
(
    [Product] => Array
        (
            [id] => 10
            [category_id] => 1
            [locale] => pol    /* it's okey! */
            [name] => Some text    /* it's okey!' */
        )

    [Category] => Array
        (
            [id] => 1
            [created] => 2009-10-03 11:22:11
            [modified] => 2009-10-03 11:22:11
        )
)

My question is: Why there is no field [Category][name] (and [Category]
[locale])?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to