You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 line
1.0KB

  1. <?php
  2. namespace domain\Config\TaxRate;
  3. use common\components\ActiveRecordCommon;
  4. class TaxRate extends ActiveRecordCommon
  5. {
  6. public static function tableName()
  7. {
  8. return 'tax_rate';
  9. }
  10. public function rules()
  11. {
  12. return [
  13. [['value'], 'number'],
  14. [['name'], 'string', 'max' => 255],
  15. ];
  16. }
  17. public function attributeLabels()
  18. {
  19. return [
  20. 'id' => 'ID',
  21. 'name' => 'Nom',
  22. 'value' => 'Valeur (0.2 pour 20%)',
  23. ];
  24. }
  25. /* Getters / Setters */
  26. public function getId(): ?int
  27. {
  28. return $this->id;
  29. }
  30. public function getName(): ?string
  31. {
  32. return $this->name;
  33. }
  34. public function setName(?string $name): self
  35. {
  36. $this->name = $name;
  37. return $this;
  38. }
  39. public function getValue(): ?float
  40. {
  41. return $this->value;
  42. }
  43. public function setValue(?float $value): self
  44. {
  45. $this->value = $value;
  46. return $this;
  47. }
  48. }