ProductUpgrade.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 ProductUpgrade extends EloquentModel
  10. {
  11. /**
  12. * Table name
  13. *
  14. * @var string
  15. */
  16. protected $table = 'tblproduct_upgrade_products';
  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 = ['product_id', 'upgrade_product_id'];
  28. protected $date = ['created_at', 'updated_at'];
  29. /**
  30. * Indicates if the model should soft delete.
  31. *
  32. * @var bool
  33. */
  34. protected $softDelete = false;
  35. /**
  36. * Indicates if the model should be timestamped.
  37. *
  38. * @var bool
  39. */
  40. public $timestamps = false;
  41. public function __construct(array $attributes = [])
  42. {
  43. parent::__construct($attributes);
  44. }
  45. public function product()
  46. {
  47. return $this->belongsTo("ThurData\Servers\KerioEmail\Core\Models\Whmcs\Product", "product_id");
  48. }
  49. public function newproduct()
  50. {
  51. return $this->belongsTo("ThurData\Servers\KerioEmail\Core\Models\Whmcs\Product", "upgrade_product_id");
  52. }
  53. }