Hi there,
Using CakePHP 1.2 (r4451).
I have a model "Study" that references itself (three attributes: id,
parent_id, name). The Model is defined as follows (extra stuff removed
for simplicity):
<?php
class Study extends AppModel {
var $name = 'Study';
var $hasMany = array(
'Study' => array(
'associationForeignKey' => 'parent_id'
)
);
var $belongsTo = array(
'Study' => array(
'foreignKey' => 'parent_id'
)
);
}
?>
I use a scaffolding controller to get up and running quickly. The
controller doesn't show me any Studies, and the debug log tells me:
SELECT `Study`.`id`, `Study`.`parent_id`, `Study`.`naam`,
`Study`.`id`, `Study`.`parent_id`, `Study`.`naam` FROM `studies` AS
`Study` LEFT JOIN `studies` AS `Study` ON `Study`.`parent_id` =
`Study`.`id` WHERE (1 = 1) LIMIT 20
Error: 1066: Not unique table/alias: 'Study'
Which seems rather logical, since the SQL query contains the alias
'Study' twice.
Am I doing something wrong, or should I report a ticket?
Regards,
Martin
--
Martin Schapendonk, [EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---