first commit symfony 6
This commit is contained in:
132
src/Entity/UserGroup.php
Normal file
132
src/Entity/UserGroup.php
Normal file
@ -0,0 +1,132 @@
|
||||
<?php
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="usergroupe",uniqueConstraints={@ORM\UniqueConstraint(columns={"user_id", "group_id"})})
|
||||
* @ORM\HasLifecycleCallbacks()
|
||||
* @ORM\Entity(repositoryClass="App\Repository\UserGroupRepository")
|
||||
*
|
||||
* @UniqueEntity(fields={"user", "group"}, message="Cette liaison existe déjà !")
|
||||
*/
|
||||
class UserGroup
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", length=60)
|
||||
*/
|
||||
private $rolegroup;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=60)
|
||||
*/
|
||||
private $apikey;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=true)
|
||||
*/
|
||||
private $visitedate;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", nullable=true)
|
||||
*/
|
||||
private $visitecpt;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="User", inversedBy="groups")
|
||||
*/
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Group", inversedBy="users")
|
||||
*/
|
||||
private $group;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getRolegroup(): ?int
|
||||
{
|
||||
return $this->rolegroup;
|
||||
}
|
||||
|
||||
public function setRolegroup(int $rolegroup): self
|
||||
{
|
||||
$this->rolegroup = $rolegroup;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getApikey(): ?string
|
||||
{
|
||||
return $this->apikey;
|
||||
}
|
||||
|
||||
public function setApikey(string $apikey): self
|
||||
{
|
||||
$this->apikey = $apikey;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getVisitedate(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->visitedate;
|
||||
}
|
||||
|
||||
public function setVisitedate(?\DateTimeInterface $visitedate): self
|
||||
{
|
||||
$this->visitedate = $visitedate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getVisitecpt(): ?int
|
||||
{
|
||||
return $this->visitecpt;
|
||||
}
|
||||
|
||||
public function setVisitecpt(?int $visitecpt): self
|
||||
{
|
||||
$this->visitecpt = $visitecpt;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUser(): ?User
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
public function setUser(?User $user): self
|
||||
{
|
||||
$this->user = $user;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getGroup(): ?Group
|
||||
{
|
||||
return $this->group;
|
||||
}
|
||||
|
||||
public function setGroup(?Group $group): self
|
||||
{
|
||||
$this->group = $group;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user