I am having problems to invoke a relationship method on a model over reflection. My models are:
class User extends \Eloquent
{
public function city()
{
return $this->belongsTo('City', 'city_id', 'id');
}
}
class City extends \Eloquent
{
}
When I invoke the city method over a ReflectionMethod instance on the User class I am not getting the City model. I think that the problem is involved with the Eloquent lazy loading, but I can't get any light over the problem :( Any ideas?
Thanks in advance for your answers!
Aucun commentaire:
Enregistrer un commentaire