<?php


namespace ModulesGarden\ProxmoxAddon\App\Services;


use MGProvision\Proxmox\v2\models\Kvm;
use MGProvision\Proxmox\v2\models\Lxc;
use ModulesGarden\ProxmoxAddon\App\Models\VmModel;

class Vm
{
    /**
     * @var Kvm|Lxc
     */
    protected $vm;
    /**
     * @var VmModel
     */
    protected $vmModel;

    /**
     * @return Kvm|Lxc
     */
    public function getVm()
    {
        return $this->vm;
    }

    /**
     * @param Kvm|Lxc $vm
     * @return Vm
     */
    public function setVm($vm)
    {
        $this->vm = $vm;
        return $this;
    }

    public function hasVm(){
        return $this->vm != null;
    }

    /**
     * @return VmModel
     */
    public function getVmModel()
    {

        if(is_null( $this->vmModel)){
            throw new \InvalidArgumentException('VmModel not set');
        }
        return $this->vmModel;
    }

    /**
     * @param VmModel $vmModel
     * @return $this
     */
    public function setVmModel(VmModel $vmModel)
    {
        $this->vmModel = $vmModel;
        return $this;
    }


    public function hasVmModel(){
        return $this->vmModel !=null;
    }
}
{


}