Fixing bugs… adding better pivot support.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
This commit is contained in:
@@ -345,6 +345,18 @@ abstract class Model {
|
||||
return new Query($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sync the original attributes with the current attributes.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
final public function sync()
|
||||
{
|
||||
$this->original = $this->attributes;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a given attribute has changed from its original state.
|
||||
*
|
||||
@@ -421,6 +433,18 @@ abstract class Model {
|
||||
$this->attributes[$key] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove an attribute from the model.
|
||||
*
|
||||
* @param string $key
|
||||
*/
|
||||
final public function purge($key)
|
||||
{
|
||||
unset($this->original[$key]);
|
||||
|
||||
unset($this->attributes[$key]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the dynamic retrieval of attributes and associations.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user