I just found a problem with the way ClassRegistry handles aliases for
associations. I wonder why nobody else has reported it, so it may be
my fault.

I have two models:

class FirstObject extends AppModel {
    public $belongsTo = array(
        'Parent' => array(
            'className' => 'FirstObject',
            'foreignKey' => 'parent_id',
        )
    );
    public $hasMany = array(
        'Children' => array(
            'className' => 'FirstObject',
            'foreignKey' => 'parent_id'
        ),
        'SecondObject'
    );
}

class SecondObject extends AppModel {
    public $belongsTo = array(
        'Parent' => array(
            'className' => 'SecondObject',
            'foreignKey' => 'parent_id',
        ),
        'FirstObject'
    );
    public $hasMany = array(
        'Children' => array(
            'className' => 'SecondObject',
            'foreignKey' => 'parent_id'
        )
    );
}

A simple FirstObject->findAll() results in a blank page caused by an
endless loop inside ClassRegistry. It seems this is because
ClassRegistry uses the alias of the association as a key.

Is something wrong with my setup or is indeed a bug with ClassRegistry
if you use the same aliases for different classes?

--~--~---------~--~----~------------~-------~--~----~
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