mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Created mutator on category checkin_email
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
9502525a41
commit
83ee07cca1
|
@ -247,6 +247,26 @@ class Category extends SnipeModel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* -----------------------------------------------
|
||||||
|
* BEGIN MUTATORS
|
||||||
|
* -----------------------------------------------
|
||||||
|
**/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This sets the checkin_value to a boolean 0 or 1. This accounts for forms or API calls that
|
||||||
|
* explicitly pass the checkin_email field but it has a null or empty value.
|
||||||
|
*
|
||||||
|
* This will also correctly parse "true"/"false" passed.
|
||||||
|
*
|
||||||
|
* @param $value
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setCheckinEmailAttribute($value)
|
||||||
|
{
|
||||||
|
$this->attributes['checkin_email'] = (int) filter_var($value, FILTER_VALIDATE_BOOLEAN);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* -----------------------------------------------
|
* -----------------------------------------------
|
||||||
* BEGIN QUERY SCOPES
|
* BEGIN QUERY SCOPES
|
||||||
|
|
Loading…
Reference in a new issue