Thursday, September 19, 2013

Receiving data

Hello to all.
I have the following models

1. Category

public $hasAndBelongsToMany = array(
'Property' => array(
'className' => 'Property',
'joinTable' => 'categories_properties',
'foreignKey' => 'category_id',
'associationForeignKey' => 'property_id',
'unique' => 'keepExisting',
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'finderQuery' => '',
'deleteQuery' => '',
'insertQuery' => ''
)
);

2. Item

public $belongsTo = array(
'Category' => array(
'className' => 'Category',
'foreignKey' => 'category_id',
'conditions' => '',
'fields' => '',
'order' => ''
)
);

3. Property

public $belongsTo = array(
'Roster' => array(
'className' => 'Roster',
'foreignKey' => 'roster_id',
'conditions' => '',
'fields' => '',
'order' => ''
)
);

public $hasAndBelongsToMany = array(
'Category' => array(
'className' => 'Category',
'joinTable' => 'categories_properties',
'foreignKey' => 'property_id',
'associationForeignKey' => 'category_id',
'unique' => 'keepExisting',
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'finderQuery' => '',
'deleteQuery' => '',
'insertQuery' => ''
)
);

When creating or editing a category I can get the data from the Property.

But when I create or edit Item I can get the data only from the category, but I would like to see the inside of an array of categories and more properties. What am I doing wrong, please tell me. Thank you very much.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: