vendor/croisiland/common-bundle/src/Entity/Price/PriceCostType.php line 28

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Croisiland\CommonBundle\Entity\Price;
  4. use Crea\ParameterBundle\Entity\Parameter;
  5. use Crea\ToolsBundle\Entity\LifecycleUserIdentifierTrait;
  6. use Croisiland\CommonBundle\Annotation\Price\PriceCostTypeFormValidator;
  7. use Croisiland\CommonBundle\Entity\Company\Company;
  8. use Croisiland\CommonBundle\Repository\Price\PriceCostTypeRepository;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Doctrine\ORM\Mapping\UniqueConstraint;
  11. /**
  12. * @ORM\Table(
  13. * uniqueConstraints={
  14. *
  15. * @UniqueConstraint(name="price_cost_type_unique",
  16. * columns={"cost_type_id", "origin_company_id"})
  17. * }
  18. * )
  19. *
  20. * @PriceCostTypeFormValidator(groups="price_cost_type_form_validator")
  21. *
  22. * @ORM\Entity(repositoryClass=PriceCostTypeRepository::class)
  23. */
  24. class PriceCostType
  25. {
  26. use LifecycleUserIdentifierTrait;
  27. /**
  28. * @ORM\Id
  29. *
  30. * @ORM\GeneratedValue
  31. *
  32. * @ORM\Column(type="integer")
  33. */
  34. private ?int $id = null;
  35. /**
  36. * @ORM\ManyToOne(targetEntity=Parameter::class)
  37. *
  38. * @ORM\JoinColumn(nullable=false)
  39. */
  40. private ?Parameter $costType = null;
  41. /**
  42. * @ORM\ManyToOne(targetEntity=Company::class, inversedBy="priceCostTypes")
  43. *
  44. * @ORM\JoinColumn(nullable=false)
  45. */
  46. private ?Company $originCompany = null;
  47. /**
  48. * @ORM\Column(type="boolean")
  49. */
  50. private bool $computed = false;
  51. public function getId(): ?int
  52. {
  53. return $this->id;
  54. }
  55. public function getCostType(): ?Parameter
  56. {
  57. return $this->costType;
  58. }
  59. public function setCostType(?Parameter $costType): self
  60. {
  61. $this->costType = $costType;
  62. return $this;
  63. }
  64. public function getOriginCompany(): ?Company
  65. {
  66. return $this->originCompany;
  67. }
  68. public function setOriginCompany(?Company $originCompany): self
  69. {
  70. $this->originCompany = $originCompany;
  71. return $this;
  72. }
  73. public function isComputed(): ?bool
  74. {
  75. return $this->computed;
  76. }
  77. public function setComputed(bool $computed): self
  78. {
  79. $this->computed = $computed;
  80. return $this;
  81. }
  82. }