<?php

namespace App;

use Eloquent;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;

/**
 * App\WuDefinicePristupu
 *
 * @property int $idwu_definice_pristupu
 * @property int $id_stanice
 * @property string|null $pass
 * @property string|null $id_wu_station
 * @property string|null $last_export
 * @method static Builder|WuDefinicePristupu newModelQuery()
 * @method static Builder|WuDefinicePristupu newQuery()
 * @method static Builder|WuDefinicePristupu query()
 * @method static Builder|WuDefinicePristupu whereIdStanice($value)
 * @method static Builder|WuDefinicePristupu whereIdWuStation($value)
 * @method static Builder|WuDefinicePristupu whereIdwuDefinicePristupu($value)
 * @method static Builder|WuDefinicePristupu whereLastExport($value)
 * @method static Builder|WuDefinicePristupu wherePass($value)
 * @mixin Eloquent
 */
class WuDefinicePristupu extends Model
{
    protected $table = 'wu_definice_pristupu';
    protected $primaryKey = 'idwu_definice_pristupu';
    protected $fillable = ['id_stanice', 'pass','id_wu_station', 'last_export'];
    public $timestamps = false;

    public static function updateExportTime($idStanice): void
    {
        self::where('id_stanice','=',$idStanice)->update(['last_export' => date('Y-m-d H:i:s')]);
    }

    public function getData()
    {
       return self::all();
    }


}


