Return `$this` in `set_attribute`
This commit is contained in:
parent
3a46721eca
commit
f2f1d4d173
|
@ -562,11 +562,12 @@ public function get_attribute($key)
|
|||
*
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
* @return Model
|
||||
*/
|
||||
public function set_attribute($key, $value)
|
||||
{
|
||||
$this->attributes[$key] = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -769,8 +770,7 @@ public function __call($method, $parameters)
|
|||
}
|
||||
elseif (starts_with($method, 'set_'))
|
||||
{
|
||||
$this->set_attribute(substr($method, 4), $parameters[0]);
|
||||
return $this;
|
||||
return $this->set_attribute(substr($method, 4), $parameters[0]);
|
||||
}
|
||||
|
||||
// Finally we will assume that the method is actually the beginning of a
|
||||
|
|
Loading…
Reference in New Issue