<?php
/**
* Created by PhpStorm.
* User: Toni Peral <toniperal.a4b@gmail.com>
* Date: 12/11/20
* Time: 11:55
*/
namespace App\Entity\System;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\System\GroupRepository")
*
* @ORM\Table(name="ps_group")
*/
class Group
{
public const GROUP_ID_GENERAL = 1;
public const GROUP_ID_WHOLESALER = 2;
public const GROUP_ID_EMPLOYEE = 3;
/**
* @var int
*
* @ORM\Id
*
* @ORM\GeneratedValue(strategy="AUTO")
*
* @ORM\Column(type="integer", name="id_group")
*/
private $id;
/**
* @var string
*
* @ORM\Column(type="string", length=32)
*/
private $name;
/**
* @var Customer[]|ArrayCollection
*
* @ORM\OneToMany(targetEntity="Customer", mappedBy="group")
*/
private $customers;
/**
* @var SubscriptionLine[]|ArrayCollection
*
* @ORM\OneToMany(targetEntity="SubscriptionLine", mappedBy="group", cascade={"persist"})
*/
private $subscriptionLines;
public function __construct()
{
$this->customers = new ArrayCollection();
$this->subscriptionLines = new ArrayCollection();
}
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @param int $id
*
* @return Group
*/
public function setId(int $id): self
{
$this->id = $id;
return $this;
}
/**
* @return string
*/
public function getName(): string
{
return $this->name;
}
/**
* @param string $name
*
* @return Group
*/
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
/**
* @return Customer[]|ArrayCollection
*/
public function getCustomers(): array
{
return $this->customers;
}
/**
* @param Customer[]|ArrayCollection $customers
*
* @return Group
*/
public function setCustomers(array $customers): self
{
$this->customers = $customers;
return $this;
}
/**
* @return SubscriptionLine[]|ArrayCollection
*/
public function getSubscriptionLines(): array
{
return $this->subscriptionLines;
}
/**
* @param SubscriptionLine[]|ArrayCollection $subscriptionLines
*
* @return Group
*/
public function setSubscriptionLines(array $subscriptionLines): self
{
$this->subscriptionLines = $subscriptionLines;
return $this;
}
}