InvoiceItem.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. namespace ThurData\Servers\KerioEmail\Core\Models\Whmcs;
  3. use \Illuminate\Database\Eloquent\Model as EloquentModel;
  4. /**
  5. * Description of Product
  6. *
  7. * @author Paweł Złamaniec <pawel.zl@thurdata.com>
  8. */
  9. class InvoiceItem extends EloquentModel
  10. {
  11. /**
  12. * Table name
  13. *
  14. * @var string
  15. */
  16. protected $table = 'tblinvoiceitems';
  17. protected $primaryKey = 'id';
  18. /**
  19. * Eloquent guarded parameters
  20. * @var array
  21. */
  22. protected $guarded = ['id'];
  23. /**
  24. * Eloquent fillable parameters
  25. * @var array
  26. */
  27. protected $fillable = ['invoiceid', 'userid', 'type', 'relid', 'description', 'amount', 'taxed', 'duedate', 'paymentmethod', 'notes'];
  28. /**
  29. * Indicates if the model should soft delete.
  30. *
  31. * @var bool
  32. */
  33. protected $softDelete = false;
  34. public function __construct(array $attributes = [])
  35. {
  36. parent::__construct($attributes);
  37. }
  38. /**
  39. * Indicates if the model should be timestamped.
  40. *
  41. * @var bool
  42. */
  43. public $timestamps = false;
  44. public function client()
  45. {
  46. return $this->hasOne("ThurData\Servers\KerioEmail\Core\Models\Whmcs\Client", "id", "userid");
  47. }
  48. public function invoice()
  49. {
  50. return $this->belongsTo("ThurData\Servers\KerioEmail\Core\Models\Whmcs\Invoice", "invoiceid");
  51. }
  52. public function hosting()
  53. {
  54. return $this->hasOne("ThurData\Servers\KerioEmail\Core\Models\Whmcs\Hosting", "id", "relid");
  55. }
  56. public function hostingAddon()
  57. {
  58. return $this->hasOne("ThurData\Servers\KerioEmail\Core\Models\Whmcs\HostingAddon", "id", "relid");
  59. }
  60. public function domain()
  61. {
  62. return $this->hasOne("ThurData\Servers\KerioEmail\Core\Models\Whmcs\Domain", "id", "relid");
  63. }
  64. public function upgrade()
  65. {
  66. return $this->hasOne("ThurData\Servers\KerioEmail\Core\Models\Whmcs\Upgrade", "id", "relid");
  67. }
  68. }