<?phpnamespace App\Entity;use App\Repository\OpportunityRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: OpportunityRepository::class)]class Opportunity{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255)] private ?string $name = null; #[ORM\Column(length: 255)] private ?string $phone = null; #[ORM\Column(length: 255)] private ?string $email = null; #[ORM\Column(length: 255, nullable: true)] private ?string $display_name = null; #[ORM\Column(nullable: true)] private ?int $priority = null; #[ORM\Column(length: 255)] private ?string $stage = null; #[ORM\Column] private ?int $expected_revenue = null; #[ORM\Column] private ?int $probability = null; #[ORM\Column(type: Types::DATETIME_MUTABLE)] private ?\DateTimeInterface $create_date = null; #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)] private ?\DateTimeInterface $date_last_stage_update = null; #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)] private ?\DateTimeInterface $date_open = null; #[ORM\Column(nullable: true)] private ?bool $active = null; #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)] private ?\DateTimeInterface $date_closed = null; #[ORM\ManyToOne(inversedBy: 'opportunities')] #[ORM\JoinColumn(nullable: true)] private ?Clients $client = null; #[ORM\ManyToOne(inversedBy: 'opportunities')] #[ORM\JoinColumn(nullable: true)] private ?User $user = null; #[ORM\ManyToOne(inversedBy: 'opportunities')] #[ORM\JoinColumn(nullable: true)] private ?UserOdoo $userOdoo = null; #[ORM\OneToMany(mappedBy: 'opportunity', targetEntity: Devis::class)] private Collection $devises; #[ORM\Column(length: 255)] private ?string $state = null; #[ORM\Column(length: 255, nullable: true)] private ?string $identifiant_odoo = null; #[ORM\Column(nullable: true)] private ?int $day_open = null; #[ORM\Column(nullable: true)] private ?int $day_close = null; #[ORM\Column(nullable: true)] private ?int $user_id_odoo = null; #[ORM\Column(nullable: true)] private ?int $client_id_odoo = null; #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)] private ?\DateTimeInterface $last_organized_datas = null; public function __construct() { $this->devises = new ArrayCollection(); } /** * fill all class properties from array * * @param array $row => array of properties * @return self */ public static function withRow( array $row , $instance = null) { if(empty($instance)) $instance = new self(); $instance->fill($row); return $instance; } protected function fill( array $row ) { // fill all properties from array foreach($row as $key=>$value) { $this->$key = $value; } } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getPhone(): ?string { return $this->phone; } public function setPhone(string $phone): self { $this->phone = $phone; return $this; } public function getEmail(): ?string { return $this->email; } public function setEmail(string $email): self { $this->email = $email; return $this; } public function getDisplayName(): ?string { return $this->display_name; } public function setDisplayName(?string $display_name): self { $this->display_name = $display_name; return $this; } public function getPriority(): ?int { return $this->priority; } public function setPriority(?int $priority): self { $this->priority = $priority; return $this; } public function getCreateDate(): ?\DateTimeInterface { return $this->create_date; } public function setCreateDate(\DateTimeInterface $create_date): self { $this->create_date = $create_date; return $this; } public function getDateLastStageUpdate(): ?\DateTimeInterface { return $this->date_last_stage_update; } public function setDateLastStageUpdate(?\DateTimeInterface $date_last_stage_update): self { $this->date_last_stage_update = $date_last_stage_update; return $this; } public function getDateOpen(): ?\DateTimeInterface { return $this->date_open; } public function setDateOpen(?\DateTimeInterface $date_open): self { $this->date_open = $date_open; return $this; } public function isActive(): ?bool { return $this->active; } public function setActive(?bool $active): self { $this->active = $active; return $this; } public function getDateClosed(): ?\DateTimeInterface { return $this->date_closed; } public function setDateClosed(?\DateTimeInterface $date_closed): self { $this->date_closed = $date_closed; return $this; } public function getClient(): ?Clients { return $this->client; } public function setClient(?Clients $client): self { $this->client = $client; return $this; } public function getUser(): ?User { return $this->user; } public function setUser(?User $user): self { $this->user = $user; return $this; } public function getUserOdoo(): ?UserOdoo { return $this->userOdoo; } public function setUserOdoo(?UserOdoo $user): self { $this->userOdoo = $user; return $this; } /** * @return Collection<int, Devis> */ public function getDevises(): Collection { return $this->devises; } public function addDevise(Devis $devise): self { if (!$this->devises->contains($devise)) { $this->devises->add($devise); $devise->setOpportunity($this); } return $this; } public function removeDevise(Devis $devise): self { if ($this->devises->removeElement($devise)) { // set the owning side to null (unless already changed) if ($devise->getOpportunity() === $this) { $devise->setOpportunity(null); } } return $this; } public function getState(): ?string { return $this->state; } public function setState(string $state): self { $this->state = $state; return $this; } public function getStage(): ?string { return $this->stage; } public function setStage(string $stage): self { $this->stage = $stage; return $this; } public function getExpectedRevenue(): ?int { return $this->expected_revenue; } public function setExpectedRevenue(int $expected_revenue): self { $this->expected_revenue = $expected_revenue; return $this; } public function getProbability(): ?int { return $this->probability; } public function setProbability(int $probability): self { $this->probability = $probability; return $this; } public function getIdentifiantOdoo(): ?string { return $this->identifiant_odoo; } public function setIdentifiantOdoo(?string $identifiant_odoo): self { $this->identifiant_odoo = $identifiant_odoo; return $this; } public function getDayOpen(): ?int { return $this->day_open; } public function setDayOpen(?int $day_open): self { $this->day_open = $day_open; return $this; } public function getDayClose(): ?int { return $this->day_close; } public function setDayClose(?int $day_close): self { $this->day_close = $day_close; return $this; } public function getUserIdOdoo(): ?int { return $this->user_id_odoo; } public function setUserIdOdoo(?int $user_id_odoo): self { $this->user_id_odoo = $user_id_odoo; return $this; } public function getClientIdOdoo(): ?int { return $this->client_id_odoo; } public function setClientIdOdoo(?int $client_id_odoo): self { $this->client_id_odoo = $client_id_odoo; return $this; } public function getLastOrganizedDatas(): ?\DateTimeInterface { return $this->last_organized_datas; } public function setLastOrganizedDatas(?\DateTimeInterface $last_organized_datas): self { $this->last_organized_datas = $last_organized_datas; return $this; }}