Morning all,

Been a while since I've been in here .. hope everyone has been happily
baking in my absence!

Got a strange problem this morning when trying to create a 'Category'
model with Tree behaviour that is associated to itself for Parent and
Child categories.  As soon as I try to reference the model I get the
following:

"Fatal error: Maximum function nesting level of '100' reached,
aborting!"

It's getting stuck in a loop of:

ClassRegistry->init( )  ..\model.php:658
Model->__construct( )   ..\class_registry.php:142
Model->__createLinks( ) ..\model.php:482
Model->__constructLinkedModel( )        ..\model.php:629

I tried turning off Zend's XDebug and then the script simply ran out
of memory instead.

I have a 'Page' model working with the same associations which I can
continue to access without issue so I'm totally stumped as to why it's
working in one instance and not the other?

To make sure I have not made any obviously silly errors I have deleted
my 'Category' table, model and controller then duplicated my working
'Page' table, model and controller changing all references of 'Page'
to 'Category' and even this fails?!?  Exactly the same table and code,
one works one does not

Any ideas?

Paul.

P.S. Here is my model:

<?php
class Category extends AppModel {

var $actsAs = array('Tree');

var $belongsTo = array(
  'Parent' => array(
    'className'=>'Category',
    'foreignKey'=>'parent_id'
  )
);

var $hasMany = array(
  'Child' => array(
    'className'=>'Category',
    'foreignKey'=>'parent_id',
    'dependent'=>true,
    'exclusive'=>true
  )
);

}

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to