<?phpnamespace App\Entity\Users;use App\Entity\BaseEntity;use Doctrine\Common\Collections\ArrayCollection;use Symfony\Component\Validator\Constraints AS Constraints;use Symfony\Component\Validator\Constraints AS Assert;use Doctrine\ORM\Mapping AS ORM;use Ramsey\Uuid\Uuid;/** * @ORM\Entity(repositoryClass="App\Repository\Users\GroupRepository") * @ORM\Table(name="users_group") * @ORM\HasLifecycleCallbacks() */class Group extends BaseEntity { /** * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="uuid") * @Assert\Uuid */ protected $uuid; /** * @var \DateTime * * @ORM\Column(type="datetime", nullable=false) * @Assert\NotBlank */ private $created; /** * @ORM\Column(type="string", length=30, nullable=true) */ private $name; /** * @ORM\OneToMany(targetEntity=User::class, mappedBy="group") * @ORM\JoinColumn(nullable=false) **/ private $users; public function __construct() { // Generate UUID $uuid = Uuid::uuid1(); $this->setUuid($uuid->toString()); // Defaults $this->created = new \DateTime(); } public function __toString() { return $this->getName(); } /** * Get Id */ public function getId() { return $this->id; } /** * Set Id * * @return self */ public function setId($id) { $this->id = $id; return $this; } /** * Get the value of uuid */ public function getUuid() { return $this->uuid; } /** * Set the value of uuid * * @return self */ public function setUuid($uuid) { $this->uuid = $uuid; return $this; } /** * Get the value of name */ public function getName() { return $this->name; } /** * Set the value of name * * @return self */ public function setName($name) { $this->name = $name; return $this; } /** * Get the value of created * * @return \DateTime */ public function getCreated() { return $this->created; } /** * Set the value of created * * @param \DateTime $created * * @return self */ public function setCreated(\DateTime $created) { $this->created = $created; return $this; }}