src/Entity/Organisation/User.php line 10
<?php
namespace App\Entity\Organisation;
use App\Entity\User\UserRoleInterface;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'organisation_user')]
#[ORM\Entity(repositoryClass: 'App\Repository\Organisation\UserRepository')]
class User implements UserRoleInterface
{
public const TYPE_ADMIN = 'admin';
public const TYPE_MANAGER = 'manager';
public const TYPE_TEACHER = 'teacher';
/**
* @var int|null
*/
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
#[ORM\Column(type: 'integer')]
private $id;
/**
* @var Organisation
*
*/
#[ORM\ManyToOne(targetEntity: 'App\Entity\Organisation\Organisation', inversedBy: 'users')]
#[ORM\JoinColumn(nullable: false)]
private $organisation;
/**
* @var \App\Entity\User\User
*
*/
#[ORM\ManyToOne(targetEntity: 'App\Entity\User\User')]
#[ORM\JoinColumn(nullable: false)]
private $user;
/**
* @var string|null
*/
#[ORM\Column(type: 'string', nullable: false)]
private $type;
public static function getTypes()
{
return [self::TYPE_ADMIN, self::TYPE_MANAGER, self::TYPE_TEACHER];
}
/**
* @return Organisation
*/
public function getOrganisation(): ?Organisation
{
return $this->organisation;
}
/**
* @param Organisation $organisation
*/
public function setOrganisation(?Organisation $organisation): void
{
$this->organisation = $organisation;
}
public function getUser(): ?\App\Entity\User\User
{
return $this->user;
}
/**
* @param \App\Entity\User\User $user
*/
public function setUser(?\App\Entity\User\User $user): void
{
$this->user = $user;
}
/**
* @return string|null
*/
public function getType(): ?string
{
return $this->type;
}
/**
* @param string|null $type
*/
public function setType(?string $type): void
{
$this->type = $type;
}
/**
* @return int|null
*/
public function getId(): ?int
{
return $this->id;
}
/**
* @param int|null $id
*/
public function setId(?int $id): void
{
$this->id = $id;
}
}