php - Eager Loading from the model in Laravel 4 -


in laravel 3, 1 following in model (http://laravel.com/docs/database/eloquent#eager):

class book extends eloquent  {      public $includes = array('author');     // line       public function author()      {            return $this->belongs_to('author');      } } 

which useful if loading same models often.

in laravel 4, adding "this line" doesn't seem cause eager loading though. doesn't seem mentioned in docs (http://four.laravel.com/docs/eloquent#eager-loading).

has been replaced else or functionality gone?


update:

i've looked @ source model (so nice read). it's now:

/**  * relations eager load on every query.  *  * @var array  */ protected $with = array(); 

is there way can suggest added (back) documentation (it seems 1 of little things can overlooked)?

the docs on github (https://github.com/laravel/docs) can requests...


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -