Cakephp HasOne (Tabelle) Beziehung nicht funktioniert

Gut, ich sehe nicht, nichts falsch mit dem code und den Tabellen im aber Probleme beim anzeigen der Daten, die ich brauche.

gegeben, dass die Tabellen sind bereits erstellt und aufgefüllt, hier ist was ich habe:

class Business extends AppModel
    {
        public $name = "Business";
        public $useTable = "businesses";

        public $hasOne = array(
        'user_profiles' => array(
            'className'     => 'profiles',
            'foreignKey'    => false,
            'conditions' => array('Business.business_id = profiles.user_id')  
        ));
    }

Ergebnis, wie ich Debuggen in meinem controller ist dieser:

array(
    (int) 0 => array(
        'Business' => array(
            'business_id' => '1',
            'business_name' => 'sysnet admin',
            'mac1' => '1f',
            'mac2' => 'af',
            'mac3' => '12',
            'mac4' => 'aa',
            'mac5' => '33',
            'mac6' => 'ba',
            'area_id' => '1',
            'latitude' => '',
            'longitude' => null,
            'province_id' => null,
            'max' => '20',
            'upload' => '0',
            'download' => '0',
            'allow_bypass' => '1',
            'bypass_pin' => '0000000',
            'gate_way' => '192.168.88.1',
            'trial' => '0',
            'hasExpired' => '0',
            'isRedirectEnabled' => '0',
            'redirectLink' => 'www.google.com',
            'group_admin_id' => '1',
            'last_access_time' => '2013-05-23 09:15:37'
        )
    ),
    (int) 1 => array(
        'Business' => array(
            'business_id' => '89',
            'business_name' => 'Panthera',
            'mac1' => 'd4',
            'mac2' => 'ca',
            'mac3' => '6d',
            'mac4' => '65',
            'mac5' => '60',
            'mac6' => '8b',
            'area_id' => '1',
            'latitude' => '14.5580',
            'longitude' => '121.0183',
            'province_id' => '1',
            'max' => '20',
            'upload' => '0',
            'download' => '0',
            'allow_bypass' => '1',
            'bypass_pin' => 'X7veJ2p',
            'gate_way' => '172.16.88.1',
            'trial' => '0',
            'hasExpired' => '0',
            'isRedirectEnabled' => '0',


            'redirectLink' => 'www.google.com',
                'group_admin_id' => '2',
                'last_access_time' => '2013-05-23 09:15:52'
            )
        ),
....
}

was zu sein scheint das problem? Ich brauche auch die user-profile angezeigt werden, mit den entsprechenden Unternehmen aufnehmen. Bitte helfen Sie. Ich habe gegoogelt Antworten, aber Im coding die gleichen lines also ich weiß nicht, wo das problem besteht.

InformationsquelleAutor Charmie | 2013-05-30
Schreibe einen Kommentar