ClientGroup.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. namespace ThurData\Servers\KerioEmail\Core\Models\Whmcs;
  3. use \Illuminate\Database\Eloquent\Model as EloquentModel;
  4. /**
  5. * Description of Category
  6. *
  7. * @var id
  8. * @var groupname
  9. * @var groupcolour
  10. * @var discountpercent
  11. * @var susptermexempt
  12. * @var separateinvoices
  13. *
  14. * @author Paweł Złamaniec <pawel.zl@thurdata.com>
  15. */
  16. class ClientGroup extends EloquentModel
  17. {
  18. /**
  19. * Table name
  20. *
  21. * @var string
  22. */
  23. protected $table = 'tblclientgroups';
  24. protected $primaryKey = 'id';
  25. /**
  26. * Eloquent guarded parameters
  27. * @var array
  28. */
  29. protected $guarded = ['id'];
  30. /**
  31. * Eloquent fillable parameters
  32. * @var array
  33. */
  34. protected $fillable = ['groupname', 'groupcolour', 'discountpercent', 'susptermexempt', 'separateinvoices'];
  35. /**
  36. * Indicates if the model should soft delete.
  37. *
  38. * @var bool
  39. */
  40. protected $softDelete = false;
  41. /**
  42. * Indicates if the model should be timestamped.
  43. *
  44. * @var bool
  45. */
  46. public $timestamps = false;
  47. public function __construct(array $attributes = [])
  48. {
  49. parent::__construct($attributes);
  50. }
  51. /**
  52. * Get client related hostings
  53. *
  54. * @return type
  55. */
  56. public function clients()
  57. {
  58. return $this->hasMany("ThurData\Servers\KerioEmail\Core\Models\Whmcs\Clients", 'groupid');
  59. }
  60. }