mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-26 21:21:18 -08:00
32 lines
530 B
PHP
32 lines
530 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Helpers\Helper;
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class SnipeModel extends Model
|
|
{
|
|
|
|
/**
|
|
* @param $value
|
|
*/
|
|
public function setPurchaseCostAttribute($value)
|
|
{
|
|
$value = Helper::ParseFloat($value);
|
|
if ($value == '0.0') {
|
|
$value = null;
|
|
}
|
|
$this->attributes['purchase_cost'] = $value;
|
|
return;
|
|
}
|
|
|
|
|
|
//
|
|
public function getDisplayNameAttribute()
|
|
{
|
|
return $this->name;
|
|
}
|
|
}
|