Hi all,
I've been making some changes to a project I'm developing and I have a model as follows:
PHP Code:
/**
* The projectlink model represents the link Project HABTM Project.
* Because of the complexity of this relationship there are two relationships: Project HABTM Parent(Project) and Project HABTM Child(Project).
*/
class ProjectLink extends AppModel {
var $name = "ProjectLink";
var $actsAs = array("Containable");
var $belongsTo = array(
"Parent" => array(
"className" => "Project",
"foreignKey" => "from_project_id"
),
"Child" => array(
"className" => "Project",
"foreignKey" => "to_project_id"
)
);
}
It's been working for at least a few months but now when I go to any of the actions relating to this model I get the following from xdebug:
Fatal error: Maximum function nesting level of '100' reached, aborting! in /Users/gid/Sites/primary-energy-research/cake/libs/debugger.php on line 248
The following function cycle is getting repeated over and over again (and the cycles are nested inside each other):
- ClassRegistry->init( )
- Model->__construct( )
- Model->__createLinks( )
- Model->__constructLinkedModel( )
So it looks like the relationships are going round in a spiral until it hits:
- ClassRegistry->init( )
- ClassRegistry->__duplicate( )
- ClassRegistry->isKeySet( )
- Debugger->handleError( )
Unfortunately after that it's got to 100 nested functions so it bails.
Any ideas guys?
Bookmarks