| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?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;
- }
- }
|