<?php

namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class WorkPoint extends BaseModel
{
    use SoftDeletes;
    public function getStatusOptions()
    {
        return Option::select('key as id', 'name')->where([
            ['table', 'work_points'],
            ['column', 'status']
        ])->get();
    }

    public function project()
    {
        return $this->belongsTo('App\Models\Project', 'project_id');
    }

    public static function getOptions()
    {
        return self::where('id', '>', 0)->get()->toArray();
    }
}
