Notice (8): Undefined index:  StageStage [CORE\cake\libs\model
\datasources\dbo_source.php, line 779] :

DboSource::queryAssociation() - CORE\cake\libs\model\datasources
\dbo_source.php, line 779
DboSource::queryAssociation() - CORE\cake\libs\model\datasources
\dbo_source.php, line 710
DboSource::read() - CORE\cake\libs\model\datasources\dbo_source.php,
line 601
Model::find() - CORE\cake\libs\model\model.php, line 1502
Model::read() - CORE\cake\libs\model\model.php, line 994
RessourceSallesController::view() - CORE\app\controllers
\ressource_salles_controller.php, line 20
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 276
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 248
[main] - CORE\app\webroot\index.php, line 84


Context :

DboSource::queryAssociation() - CORE\cake\libs\model\datasources
\dbo_source.php, line 779
DboSource::queryAssociation() - CORE\cake\libs\model\datasources
\dbo_source.php, line 710
DboSource::read() - CORE\cake\libs\model\datasources\dbo_source.php,
line 601
Model::find() - CORE\cake\libs\model\model.php, line 1502
Model::read() - CORE\cake\libs\model\model.php, line 994
RessourceSallesController::view() - CORE\app\controllers
\ressource_salles_controller.php, line 20
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 276
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 248
[main] - CORE\app\webroot\index.php, line 84


Code :

if ($type == 'hasAndBelongsToMany') {


                        $merge = array();


                        foreach($fetch as $j => $data) {


                            if(isset($data[$with]) && $data[$with]
[$foreignKey] === $row[$model->name][$model->primaryKey]) {  // <-
here's the problem


                                if ($habtmFieldsCount > 2) {



My HABTM'ed models :

class ClientStagiaire extends AppModel {

        var $name = 'ClientStagiaire';
        var $recursive=2;
        var $displayField = 'nom' ;
        var $belongsTo = array(
                        'Societe' => array('className' => 'ClientSociete',
                                                                'foreignKey' => 
'societe_id',
                                                                'conditions' => 
'',
                                                                'fields' => '',
                                                                'order' => '',
                                                                'counterCache' 
=> ''),
        );

        var $hasAndBelongsToMany = array(
        'Stage' =>
            array('className'            => 'StageStage',
                'joinTable'              =>
'stage_stages_stage_stagiaires',
                'foreignKey'             => 'stagiaire_id',
                'associationForeignKey'  => 'stage_id',
                'conditions'             => '',
                'order'                  => '',
                'limit'                  => '',
                'uniq'                   => true,
                'finderQuery'              => '',
                'deleteQuery'            => '',
                'insertQuery'             => ''
            )
        );
}

class StageStage extends AppModel {

        var $recursive=2;
        var $name = 'StageStage';
        var $hasMany = array(
                'Date' => array('className' => 'StageDate',
                                        'foreignKey' => 'stage_id',
                                        'conditions' => '',
                                        'fields' => '',
                                        'order' => '',
                                        'limit' => '',
                                        'offset' => '',
                                        'dependent' => '',
                                        'exclusive' => '',
                                        'finderQuery' => '',
                                        'counterQuery' => ''
                        ),
                'Document' => array('className' => 'StageDocument',
                                        'foreignKey' => 'stage_id',
                                        'conditions' => '',
                                        'fields' => '',
                                        'order' => '',
                                        'limit' => '',
                                        'offset' => '',
                                        'dependent' => '',
                                        'exclusive' => '',
                                        'finderQuery' => '',
                                        'counterQuery' => ''
                        ),

                );
        var $belongsTo = array(
                'Formateur' => array('className' => 'RessourceFormateur',
                                                        'foreignKey' => 
'formateur_id',
                                                        'conditions' => '',
                                                        'fields' => '',
                                                        'order' => '',
                                                        'limit' => '',
                                                        'offset' => '',
                                                        'dependent' => '',
                                                        'exclusive' => '',
                                                        'finderQuery' => '',
                                                        'counterQuery' => ''),
                'Salle' => array('className' => 'RessourceSalle',
                                                        'foreignKey' => 
'salle_id',
                                                        'conditions' => '',
                                                        'fields' => '',
                                                        'order' => '',
                                                        'limit' => '',
                                                        'offset' => '',
                                                        'dependent' => '',
                                                        'exclusive' => '',
                                                        'finderQuery' => '',
                                                        'counterQuery' => ''),
                'Formation' => array('className' => 'CatalogueFormation',
                                                        'foreignKey' => 
'formation_id',
                                                        'conditions' => '',
                                                        'fields' => '',
                                                        'order' => '',
                                                        'limit' => '',
                                                        'offset' => '',
                                                        'dependent' => '',
                                                        'exclusive' => '',
                                                        'finderQuery' => '',
                                                        'counterQuery' => ''),
                );
        var $hasAndBelongsToMany = array(
        'Stagiaire' => array('className' => 'ClientStagiaire',
                                                'joinTable' => 
'stage_stages_stage_stagiaires',
                                                'foreignKey' => 'stage_id',
                                                'associationForeignKey' => 
'stagiaire_id',
                                                'conditions' => '',
                                                'order' => '',
                                                'limit' => '',
                                                'uniq' => true,
                                                'finderQuery' => '',
                                                'deleteQuery' => '',
                                                'insertQuery' => ''
            )
        );
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to