RecoveryVm.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /* * ********************************************************************
  3. * ProxmoxAddon product developed. (Aug 22, 2018)
  4. * *
  5. *
  6. * CREATED BY MODULESGARDEN -> http://modulesgarden.com
  7. * CONTACT -> contact@modulesgarden.com
  8. *
  9. *
  10. * This software is furnished under a license and may be used and copied
  11. * only in accordance with the terms of such license and with the
  12. * inclusion of the above copyright notice. This software or any other
  13. * copies thereof may not be provided or otherwise made available to any
  14. * other person. No title to and ownership of the software is hereby
  15. * transferred.
  16. *
  17. *
  18. * ******************************************************************** */
  19. namespace ModulesGarden\ProxmoxAddon\App\Models;
  20. use Illuminate\Database\Eloquent\model as EloquentModel;
  21. /**
  22. * Description of RecoveryVm
  23. *
  24. * @author Pawel Kopec <pawelk@modulesgardne.com>
  25. * @property int $id
  26. * @property int $client_id
  27. * @property int $service_id
  28. * @property int $server_id
  29. * @property int $vserver_id
  30. * @property string $node
  31. * @property int $vmid
  32. * @property string $virtualization
  33. * @property string $config
  34. * @property string $status
  35. * @property string $dns
  36. * @property string $last_update
  37. * @property \ModulesGarden\ProxmoxAddon\Core\Models\Whmcs\Hosting $hosting Related hosting
  38. */
  39. class RecoveryVm extends EloquentModel
  40. {
  41. public $timestamps = false;
  42. protected $table = 'mg_proxmox_addon_recovery_vm_list';
  43. /**
  44. *
  45. *
  46. */
  47. protected $guarded = ['id'];
  48. /**
  49. *
  50. * @var array
  51. */
  52. protected $fillable = ['client_id', 'service_id', 'server_id', 'vserver_id', 'node', 'vmid', 'virtualization', 'config', 'status', 'dns', 'last_update'];
  53. protected $softDelete = false;
  54. public function getConfig()
  55. {
  56. return json_decode($this->config, true);
  57. }
  58. public function getStatus()
  59. {
  60. return json_decode($this->status, true);
  61. }
  62. public function getDns()
  63. {
  64. return json_decode($this->dns, true);
  65. }
  66. /**
  67. * Get related hosting
  68. *
  69. * @return type
  70. */
  71. public function hosting()
  72. {
  73. return $this->belongsTo(\ModulesGarden\ProxmoxAddon\Core\Models\Whmcs\Hosting::class, "service_id");
  74. }
  75. }