src/Entity/ReporterPartner.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ReporterPartnerRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ReporterPartnerRepository::class)
  9.  */
  10. class ReporterPartner
  11. {
  12.     public const MOST_RELEVANT_COUNTRIES = [
  13.         'Australia',
  14.         'Brazil',
  15.         'Canada',
  16.         'China',
  17.         'EU-28',
  18.         'Guinea',
  19.         'India',
  20.         'Japan',
  21.         'Qatar',
  22.         'Russian Federation',
  23.         'Saudi Arabia',
  24.         'United Arab Emirates',
  25.         'USA',
  26.     ];
  27.     public const MOST_RELEVANT_PARTNERS = [
  28.         'Australia',
  29.         'Brazil',
  30.         'Canada',
  31.         'China',
  32.         'EU-28',
  33.         'Guinea',
  34.         'India',
  35.         'Japan',
  36.         'Qatar',
  37.         'Russian Federation',
  38.         'Saudi Arabia',
  39.         'United Arab Emirates',
  40.         'USA',
  41.         'World',
  42.     ];
  43.     public const COMMODITY_CODE = [
  44.         2606 => 'Bauxite',
  45.         2818 => 'Alumina',
  46.         7601 => 'Aluminium',
  47.         7602 => 'Scrap',
  48.         7604 => 'Extrusions',
  49.         7606 => 'Rolled Products',
  50.         7607 => 'Foil',
  51.     ];
  52.     public const BACKGROUNDCOLOR = [
  53.         2606 => '#7F301B',
  54.         2818 => '#A293AB',
  55.         7601 => '#AAB4C4',
  56.         7602 => '#7DAA9D',
  57.         7604 => '#9C9E9C',
  58.         7606 => '#2988A5',
  59.         7607 => '#688C50',
  60.     ];
  61.     public const BACKGROUNDCOLOR_DARKER = [
  62.         2606 => '#592213',
  63.         2818 => '#73617d',
  64.         7601 => '#697b97',
  65.         7602 => '#527d70',
  66.         7604 => '#6d6f6d',
  67.         7606 => '#1d5f73',
  68.         7607 => '#496238',
  69.     ];
  70.     public const ICONCLASS = [
  71.         2606 => 'bauxite',
  72.         2818 => 'alumina',
  73.         7601 => 'aluminium',
  74.         7602 => 'scrap',
  75.         7604 => 'extrusion',
  76.         7606 => 'rolled_products',
  77.         7607 => 'foil',
  78.     ];
  79.     /**
  80.      * @ORM\Id
  81.      * @ORM\GeneratedValue
  82.      * @ORM\Column(type="integer")
  83.      */
  84.     private $id;
  85.     /**
  86.      * @ORM\Column(type="string", length=255)
  87.      */
  88.     private $reporter;
  89.     /**
  90.      * @ORM\Column(type="string", length=255)
  91.      */
  92.     private $partner;
  93.     /**
  94.      * @ORM\Column(type="string", length=255)
  95.      */
  96.     private $tradeFlow;
  97.     /**
  98.      * @ORM\Column(type="integer")
  99.      */
  100.     private $commodityCode;
  101.     /**
  102.      * @ORM\OneToMany(targetEntity=Period::class, mappedBy="reporterPartner", cascade={"persist", "remove"}, orphanRemoval=true)
  103.      */
  104.     private $periods;
  105.     public function __construct()
  106.     {
  107.         $this->periods = new ArrayCollection();
  108.     }
  109.     public function getId(): ?int
  110.     {
  111.         return $this->id;
  112.     }
  113.     public function getReporter(): ?string
  114.     {
  115.         return $this->reporter;
  116.     }
  117.     public function setReporter(string $reporter): self
  118.     {
  119.         $this->reporter $reporter;
  120.         return $this;
  121.     }
  122.     public function getPartner(): ?string
  123.     {
  124.         return $this->partner;
  125.     }
  126.     public function setPartner(string $partner): self
  127.     {
  128.         $this->partner $partner;
  129.         return $this;
  130.     }
  131.     public function getTradeFlow(): ?string
  132.     {
  133.         return $this->tradeFlow;
  134.     }
  135.     public function setTradeFlow(string $tradeFlow): self
  136.     {
  137.         $this->tradeFlow $tradeFlow;
  138.         return $this;
  139.     }
  140.     public function getCommodityCode(): ?int
  141.     {
  142.         return $this->commodityCode;
  143.     }
  144.     public function setCommodityCode(int $commodityCode): self
  145.     {
  146.         $this->commodityCode $commodityCode;
  147.         return $this;
  148.     }
  149.     /**
  150.      * @return Collection|Period[]
  151.      */
  152.     public function getPeriods(): Collection
  153.     {
  154.         return $this->periods;
  155.     }
  156.     public function addPeriod(Period $period): self
  157.     {
  158.         if (!$this->periods->contains($period)) {
  159.             $this->periods[] = $period;
  160.         }
  161.         return $this;
  162.     }
  163.     public function removePeriod(Period $period): self
  164.     {
  165.         $this->periods->removeElement($period);
  166.         return $this;
  167.     }
  168. }