Commit f2f1d4d1 authored by Pavel Puchkin's avatar Pavel Puchkin

Return `$this` in `set_attribute`

parent 3a46721e
...@@ -441,7 +441,7 @@ abstract class Model { ...@@ -441,7 +441,7 @@ abstract class Model {
} }
/** /**
*Updates the timestamp on the model and immediately saves it. * Updates the timestamp on the model and immediately saves it.
* *
* @return void * @return void
*/ */
...@@ -562,11 +562,12 @@ abstract class Model { ...@@ -562,11 +562,12 @@ abstract class Model {
* *
* @param string $key * @param string $key
* @param mixed $value * @param mixed $value
* @return void * @return Model
*/ */
public function set_attribute($key, $value) public function set_attribute($key, $value)
{ {
$this->attributes[$key] = $value; $this->attributes[$key] = $value;
return $this;
} }
/** /**
...@@ -769,8 +770,7 @@ abstract class Model { ...@@ -769,8 +770,7 @@ abstract class Model {
} }
elseif (starts_with($method, 'set_')) elseif (starts_with($method, 'set_'))
{ {
$this->set_attribute(substr($method, 4), $parameters[0]); return $this->set_attribute(substr($method, 4), $parameters[0]);
return $this;
} }
// Finally we will assume that the method is actually the beginning of a // Finally we will assume that the method is actually the beginning of a
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment