On Fri, Sep 10, 2010 at 6:55 AM, emmexx <[email protected]> wrote:
> I have to access some table created by others outside of cakephp.
>
> 2 of the tables are related by a hasOne relationship but the second
> table has a primary key that is *the* foreign key. Please don't ask! :-
> (
> I can't change the tables.
> I used the following models in cake:
>
> table1:
>
> class t1 extends AppModel {
>
>        var $name = 't1';
>        var $useDbConfig = 'other';
>        var $useTable = 'externalt1';
>
>        var $hasOne = array(
>                'T2' => array(
>                        'className' => 'T2',
>                        'foreignKey' => 'id',
>                        'dependent' => false,
>                        'conditions' => '',
>                        'fields' => '',
>                        'order' => ''
>                )
>        );
> }
>
> table2:
>
> class T2 extends AppModel {
>
>        var $name = 'T2';
>        var $useDbConfig = 'other';
>        var $useTable = 'externalt2';
> }
>
> In the t1 controller I put a find('all'):
> $this->log($this->T1->find('all')); // in index (just a test)
>
> But when I go to T1s address I get a blank page and nothing in the log
> file.

That may be a fatal error. If PHP craps out it won't be able to log
anything. Check your server's log.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" 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