Pricing.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. namespace ModulesGarden\Servers\ProxmoxVps\Core\Models\Whmcs;
  3. use \Illuminate\Database\Eloquent\Model as EloquentModel;
  4. /**
  5. * Description of Product
  6. *
  7. * @author Paweł Złamaniec <pawel.zl@modulesgarden.com>
  8. */
  9. class Pricing extends EloquentModel
  10. {
  11. /**
  12. * Table name
  13. *
  14. * @var string
  15. */
  16. protected $table = 'tblpricing';
  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 = ['type', 'currency', 'currencyModel', 'relid', 'msetupfee', 'qsetupfee', 'ssetupfee', 'asetupfee', 'bsetupfee', 'tsetupfee', 'monthly', 'quarterly', 'semiannually', 'annually', 'biennially', 'triennially'];
  28. /**
  29. * Indicates if the model should soft delete.
  30. *
  31. * @var bool
  32. */
  33. protected $softDelete = false;
  34. /**
  35. * Indicates if the model should be timestamped.
  36. *
  37. * @var bool
  38. */
  39. public $timestamps = false;
  40. public function __construct(array $attributes = [])
  41. {
  42. parent::__construct($attributes);
  43. }
  44. /**
  45. * Adds query condition to limit result records only to domains pricing
  46. */
  47. public function domainPricing()
  48. {
  49. $this->whereIn('tblpricing.type', ['domaintransfer', 'domainrenew', 'domainregister']);
  50. return $this;
  51. }
  52. public function currencyModel()
  53. {
  54. return $this->belongsTo("ModulesGarden\Servers\ProxmoxVps\Core\Models\Whmcs\Currency", "currency");
  55. }
  56. }