For my case, edit the php.ini from "xdebug.max_nesting_level = 100" to "xdebug.max_nesting_level = 200" is not a good solution for me. if there is 199 records in my table, it's works. However, if there is 201 records, it can't work anymore:
Fatal error: Maximum function nesting level of '200' reached, aborting!
So if I have 3000 records right now and does it means I need set the value xdebug.max_nesting_level to the value greater than 3000 ?
This is my case for an example:
route.php, the file calling a model
Route::get('catalog', function() {
$data = cFamily::where("family_id","<","2")->get();
foreach($data AS $row ){
echo $row->family_id;
}
});
And here is the model:
<?php
class cFamily extends Eloquent{
protected $table = 'c_family';
protected $primaryKey = 'family_id';
public function cOrder()
{
return $this->belongsTo('cOrder','order_id','order_ref_id');
}
public function cFamily()
{
return $this->hasOne('cFamily','class_id','class_ref_id');
}
}
There is a family model but it shows a family has another family, it has one itself ?!? And then i rewrite the wrong function in this model so that it would not reach 100 nested calls again.
<?php
class cFamily extends Eloquent{
protected $table = 'c_family';
protected $primaryKey = 'family_id';
public function cOrder()
{
return $this->belongsTo('cOrder','order_id','order_ref_id');
}//EOF cKingdom()
public function cGenus()
{
return $this->hasOne('cGenus','family_id','family_ref_id');
}//EOF cOrder()
}
Reference:
http://stackoverflow.com/questions/26231028/php-fatal-error-maximum-function-nesting-level-of-100-reached-aborting-in-l
http://stackoverflow.com/questions/12346384/fatal-error-maximum-function-nesting-level-of-100-reached-aborting-with-ion?rq=1
No comments :
Post a Comment