Skip to content

Commit

Permalink
Added a missing mutator
Browse files Browse the repository at this point in the history
  • Loading branch information
REBELinBLUE committed Feb 4, 2016
1 parent 00aa467 commit 3a9a5db
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions app/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/**
* Server model.
* @todo See if there is a cleaner way to do the mutators as they are all very similar
*/
class Server extends Model
{
Expand Down Expand Up @@ -82,6 +83,22 @@ public function setUserAttribute($value)
$this->attributes['user'] = $value;
}

/**
* Define a mutator for the path, if it has changed or has
* not previously been set also set the status to untested.
*
* @param string $value
* @return void
*/
public function setPathAttribute($value)
{
if (!array_key_exists('path', $this->attributes) || $value !== $this->attributes['path']) {
$this->attributes['status'] = self::UNTESTED;
}

$this->attributes['path'] = $value;
}

/**
* Define a mutator for the IP Address, if it has changed or
* has not previously been set also set the status to untested.
Expand Down

0 comments on commit 3a9a5db

Please sign in to comment.