<?php

namespace App;

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

/**
 * App\MqttServerSet
 *
 * @property int $idmqtt_server_set
 * @property string|null $nazev
 * @property string|null $ipadresa
 * @property int|null $aktivni
 * @property int|null $vlozil
 * @method static Builder|MqttServerSet newModelQuery()
 * @method static Builder|MqttServerSet newQuery()
 * @method static Builder|MqttServerSet query()
 * @method static Builder|MqttServerSet whereAktivni($value)
 * @method static Builder|MqttServerSet whereIdmqttServerSet($value)
 * @method static Builder|MqttServerSet whereIpadresa($value)
 * @method static Builder|MqttServerSet whereNazev($value)
 * @method static Builder|MqttServerSet whereVlozil($value)
 * @mixin Eloquent
 */
class MqttServerSet extends Model
{
    protected $table = 'mqtt_server_set';
    protected $primaryKey = 'idmqtt_server_set';
    protected $fillable = ['nazev','ipadresa','aktivni','vlozil'];
    public $timestamps = false;

    public static function getAktivniServer()
    {
        return self::all()->where('aktivni', '=', 1)->first()->get();

    }
}
