<?php
namespace App\Entity;
use App\Entity\Common\SoftDeletableEntityTrait;
use App\Entity\Common\StatefulEntityTrait;
use App\Entity\Common\TimestampedEntityTrait;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping\UniqueConstraint;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Evence\Bundle\SoftDeleteableExtensionBundle\Mapping\Annotation as Evence;
/**
* Class Company
*
* @ORM\Entity(repositoryClass="App\Repository\CompanyRepository")
* @ORM\Table(indexes={
* @ORM\Index(name="IDX_updated_at", columns={"updated_at"}),
* @ORM\Index(name="IDX_deleted_at", columns={"deleted_at"}),
* @ORM\Index(name="IDX_is_active", columns={"is_active"}),
* @ORM\Index(name="IDX_password", columns={"name"})
* }
* ,uniqueConstraints={
* @UniqueConstraint(name="UNIQ_phone", columns={"phone"}),
* @UniqueConstraint(name="UNIQ_email", columns={"email"}),
* })
* @Gedmo\SoftDeleteable(fieldName="deletedAt")
*/
class Company
{
use SoftDeletableEntityTrait, StatefulEntityTrait, TimestampedEntityTrait;
public function __construct() {
$this->companyDocuments = new ArrayCollection();
}
/**
* @var integer
*
* @ORM\Id()
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="StaCompanyType")
* @ORM\JoinColumn(name="company_type", referencedColumnName="code", onDelete="CASCADE")
*/
private $companyType;
/**
* @var string
*
* @ORM\Column(length=100)
*/
private $name;
/**
* @var string|null
*
* @ORM\Column(length=100,nullable=true)
*/
private $companyName;
/**
* @var string
*
* @ORM\Column(length=100)
*/
private $address;
/**
* @var string
*
* @ORM\Column(length=100)
*/
private $email;
/**
* @var string|null
*
* @ORM\Column(length=50,nullable=true)
*/
private $phone;
/**
* @var string|null
*
* @ORM\Column(length=50,nullable=true)
*/
private $taxId;
/**
* @var string|null
*
* @ORM\Column(length=50,nullable=true)
*/
private $taxOffice;
/**
* @var string|null
*
* @ORM\Column(length=1,nullable=true,options={"default":"C"})
*/
private $paymentType="C";
/**
* @var string|null
*
* @ORM\Column(length=1,nullable=true,options={"default":"C"})
*/
private $companyStatus="C";
/**
* @var float|true
*
* @ORM\Column(type="decimal", precision=13, scale=4,nullable=true)
*/
private $credit;
/**
* @var StaCurrency|null
*
* @ORM\ManyToOne(targetEntity="StaCurrency")
* @ORM\JoinColumn(name="currency_code", referencedColumnName="code", onDelete="CASCADE", nullable=true)
*/
private $currency;
/**
* @var string|null
*
* @ORM\Column(length=1000,nullable=true)
*/
private $remarks;
/**
* @ORM\OneToMany(targetEntity="CompanyDocument", mappedBy="company")
*/
private $companyDocuments;
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @param int $id
* @return Company
*/
public function setId(int $id): Company
{
$this->id = $id;
return $this;
}
/**
* @return mixed
*/
public function getCompanyType()
{
return $this->companyType;
}
/**
* @param mixed $companyType
* @return Company
*/
public function setCompanyType($companyType)
{
$this->companyType = $companyType;
return $this;
}
/**
* @return string
*/
public function getName(): string
{
return $this->name;
}
/**
* @param string $name
* @return Company
*/
public function setName(string $name): Company
{
$this->name = $name;
return $this;
}
/**
* @return string
*/
public function getAddress(): string
{
return $this->address;
}
/**
* @param string $address
* @return Company
*/
public function setAddress(string $address): Company
{
$this->address = $address;
return $this;
}
/**
* @return string
*/
public function getEmail(): string
{
return $this->email;
}
/**
* @param string $email
* @return Company
*/
public function setEmail(string $email): Company
{
$this->email = $email;
return $this;
}
/**
* @return string|null
*/
public function getPhone(): ?string
{
return $this->phone;
}
/**
* @param string|null $phone
* @return Company
*/
public function setPhone(?string $phone): Company
{
$this->phone = $phone;
return $this;
}
/**
* @return string|null
*/
public function getTaxId(): ?string
{
return $this->taxId;
}
/**
* @param string|null $taxId
* @return Company
*/
public function setTaxId(?string $taxId): Company
{
$this->taxId = $taxId;
return $this;
}
/**
* @return string|null
*/
public function getTaxOffice(): ?string
{
return $this->taxOffice;
}
/**
* @param string|null $taxOffice
* @return Company
*/
public function setTaxOffice(?string $taxOffice): Company
{
$this->taxOffice = $taxOffice;
return $this;
}
public function getCompanyName(): ?string
{
return $this->companyName;
}
public function setCompanyName(?string $companyName): Company
{
$this->companyName = $companyName;
return $this;
}
public function getPaymentType(): ?string
{
return $this->paymentType;
}
public function setPaymentType(?string $paymentType): Company
{
$this->paymentType = $paymentType;
return $this;
}
/**
* @return float|true
*/
public function getCredit()
{
return $this->credit;
}
/**
* @param float|true $credit
* @return Company
*/
public function setCredit($credit)
{
$this->credit = $credit;
return $this;
}
public function getCurrency(): ?StaCurrency
{
return $this->currency;
}
public function setCurrency(?StaCurrency $currency): Company
{
$this->currency = $currency;
return $this;
}
public function getCompanyDocuments()
{
return $this->companyDocuments;
}
public function setCompanyDocuments(ArrayCollection $companyDocuments): Company
{
$this->companyDocuments = $companyDocuments;
return $this;
}
public function getCompanyStatus(): ?string
{
return $this->companyStatus;
}
public function setCompanyStatus(?string $companyStatus): Company
{
$this->companyStatus = $companyStatus;
return $this;
}
public function getRemarks(): ?string
{
return $this->remarks;
}
public function setRemarks(?string $remarks): Company
{
$this->remarks = $remarks;
return $this;
}
}