<?php
namespace App\Entity;
use App\Entity\Traits\Idable;
use App\Repository\CompanyRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: CompanyRepository::class)]
#[ORM\Table(name: 'companies')]
class Company
{
use Idable;
#[ORM\Column(type: 'string', length: 255)]
private ?string $name;
#[ORM\Column(type: 'string')]
private $currency;
#[ORM\Column(type: 'boolean')]
private ?bool $isActive;
#[ORM\Column(nullable: true)]
#[ORM\ManyToOne(targetEntity: Company::class, inversedBy: 'children')]
private ?Company $parent = null;
#[ORM\Column(nullable: true)]
#[ORM\OneToMany(mappedBy: 'parent', targetEntity: Company::class)]
private $children;
#[ORM\Column(nullable: true)]
#[ORM\OneToMany(mappedBy: 'company', targetEntity: User::class)]
private $users;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $uid;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $locationType ;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $notificationEmail ;
#[ORM\Column(type: 'float', precision: 15, scale: 4, nullable: true)]
private $credit;
#[ORM\Column(type: 'float', precision: 15, scale: 4, nullable: true)]
private $creditBalance;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $corporateCardId;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private string $vatNumber;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private string $vatOffice;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private string $registrationNumber;
#[ORM\Column(type: 'boolean', options: ['default' => 1])]
private ?bool $isCreditActive;
#[ORM\Column(type: 'string', nullable: true)]
protected $contactName;
#[ORM\Column(type: 'string', nullable: true)]
protected $contactPhone;
#[ORM\Column(type: 'string', length: 180, nullable: true)]
protected $contactEmail;
#[ORM\Column(type: 'string', nullable: true)]
protected $financeContactName;
#[ORM\Column(type: 'string', nullable: true)]
protected $financeContactPhone;
#[ORM\Column(type: 'string', length: 180, nullable: true)]
protected $financeContactEmail;
public function __construct()
{
$this->children = new ArrayCollection();
$this->users = new ArrayCollection();
}
/**
* @return mixed
*/
public function getFinanceContactName()
{
return $this->financeContactName;
}
/**
* @param mixed $financeContactName
*/
public function setFinanceContactName($financeContactName): void
{
$this->financeContactName = $financeContactName;
}
/**
* @return mixed
*/
public function getFinanceContactPhone()
{
return $this->financeContactPhone;
}
/**
* @param mixed $financeContactPhone
*/
public function setFinanceContactPhone($financeContactPhone): void
{
$this->financeContactPhone = $financeContactPhone;
}
/**
* @return mixed
*/
public function getFinanceContactEmail()
{
return $this->financeContactEmail;
}
/**
* @param mixed $financeContactEmail
*/
public function setFinanceContactEmail($financeContactEmail): void
{
$this->financeContactEmail = $financeContactEmail;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): void
{
$this->name = $name;
}
/**
* @return mixed
*/
public function getCurrency()
{
return $this->currency;
}
/**
* @param mixed $currency
*/
public function setCurrency($currency): void
{
$this->currency = $currency;
}
public function getIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(?bool $isActive): void
{
$this->isActive = $isActive;
}
public function getParent(): ?Company
{
return $this->parent;
}
public function setParent(?Company $parent): void
{
$this->parent = $parent;
}
public function getChildren(): ArrayCollection|null
{
return $this->children;
}
public function setChildren(ArrayCollection $children): void
{
$this->children = $children;
}
public function getUsers(): ArrayCollection|null
{
return $this->users;
}
public function setUsers(ArrayCollection $users): void
{
$this->users = $users;
}
public function getUid(): ?string
{
return $this->uid;
}
public function setUid(?string $uid): void
{
$this->uid = $uid;
}
public function getLocationType(): string|null
{
return $this->locationType ;
}
public function setLocationType(string $locationType): void
{
$this->locationType = $locationType;
}
public function getNotificationEmail(): string|null
{
return $this->notificationEmail;
}
public function setNotificationEmail(string $notificationEmail): void
{
$this->notificationEmail = $notificationEmail;
}
/**
* @return mixed
*/
public function getCredit()
{
return $this->credit;
}
/**
* @param mixed $credit
*/
public function setCredit($credit): void
{
$this->credit = $credit;
}
/**
* @return mixed
*/
public function getCreditBalance()
{
return $this->creditBalance;
}
/**
* @param mixed $creditBalance
*/
public function setCreditBalance($creditBalance): void
{
$this->creditBalance = $creditBalance;
}
public function getCorporateCardId(): ?string
{
return $this->corporateCardId;
}
public function setCorporateCardId(?string $corporateCardId): void
{
$this->corporateCardId = $corporateCardId;
}
public function getVatNumber(): string
{
return $this->vatNumber;
}
public function setVatNumber(string $vatNumber): void
{
$this->vatNumber = $vatNumber;
}
public function getVatOffice(): string
{
return $this->vatOffice;
}
public function setVatOffice(string $vatOffice): void
{
$this->vatOffice = $vatOffice;
}
public function getRegistrationNumber(): string
{
return $this->registrationNumber;
}
public function setRegistrationNumber(string $registrationNumber): void
{
$this->registrationNumber = $registrationNumber;
}
public function getIsCreditActive(): ?bool
{
return $this->isCreditActive;
}
public function setIsCreditActive(?bool $isCreditActive): void
{
$this->isCreditActive = $isCreditActive;
}
/**
* @return mixed
*/
public function getContactName()
{
return $this->contactName;
}
/**
* @param mixed $contactName
*/
public function setContactName($contactName): void
{
$this->contactName = $contactName;
}
/**
* @return mixed
*/
public function getContactPhone()
{
return $this->contactPhone;
}
/**
* @param mixed $contactPhone
*/
public function setContactPhone($contactPhone): void
{
$this->contactPhone = $contactPhone;
}
/**
* @return mixed
*/
public function getContactEmail()
{
return $this->contactEmail;
}
/**
* @param mixed $contactEmail
*/
public function setContactEmail($contactEmail): void
{
$this->contactEmail = $contactEmail;
}
}