Fixing spacing in Eloquent.

This commit is contained in:
Taylor Otwell 2011-06-17 14:52:33 -07:00
parent e3ffb3f171
commit 21c1249484
1 changed files with 5 additions and 5 deletions

View File

@ -289,9 +289,9 @@ public function has_and_belongs_to_many($model, $table = null)
$this->relating_key = Str::lower(get_class($this)).'_id';
return static::make($model)
->select(static::table($model).'.*')
->join($this->relating_table, static::table($model).'.id', '=', $this->relating_table.'.'.Str::lower($model).'_id')
->where($this->relating_table.'.'.$this->relating_key, '=', $this->id);
->select(static::table($model).'.*')
->join($this->relating_table, static::table($model).'.id', '=', $this->relating_table.'.'.Str::lower($model).'_id')
->where($this->relating_table.'.'.$this->relating_key, '=', $this->id);
}
/**
@ -393,8 +393,8 @@ public function __get($key)
$model = $this->$key();
return ($this->relating == 'has_one' or $this->relating == 'belongs_to')
? $this->ignore[$key] = $model->first()
: $this->ignore[$key] = $model->get();
? $this->ignore[$key] = $model->first()
: $this->ignore[$key] = $model->get();
}
return (array_key_exists($key, $this->attributes)) ? $this->attributes[$key] : null;