90 lines
1.9 KiB
PHP
90 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use App\Repository\UserOrganizationAppRepository;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
#[ORM\Entity(repositoryClass: UserOrganizationAppRepository::class)]
|
|
class UserOrganizationApp
|
|
{
|
|
#[ORM\Id]
|
|
#[ORM\GeneratedValue]
|
|
#[ORM\Column]
|
|
private ?int $id = null;
|
|
|
|
#[ORM\Column]
|
|
private ?\DateTimeImmutable $createdAt = null;
|
|
|
|
|
|
#[ORM\Column]
|
|
private ?bool $isActive;
|
|
|
|
#[ORM\ManyToOne(inversedBy: 'userOrganizationApps')]
|
|
#[ORM\JoinColumn(nullable: false)]
|
|
private ?UsersOrganizations $userOrganization = null;
|
|
|
|
#[ORM\ManyToOne(inversedBy: 'userOrganizationApps')]
|
|
#[ORM\JoinColumn(nullable: false)]
|
|
private ?Apps $application = null;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->createdAt = new \DateTimeImmutable(); // Set createdAt to current time
|
|
$this->isActive = true; // Default value for isActive
|
|
}
|
|
|
|
public function getId(): ?int
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getCreatedAt(): ?\DateTimeImmutable
|
|
{
|
|
return $this->createdAt;
|
|
}
|
|
|
|
public function setCreatedAt(\DateTimeImmutable $createdAt): static
|
|
{
|
|
$this->createdAt = $createdAt;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function isActive(): ?bool
|
|
{
|
|
return $this->isActive;
|
|
}
|
|
|
|
public function setIsActive(bool $isActive): static
|
|
{
|
|
$this->isActive = $isActive;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getUserOrganization(): ?UsersOrganizations
|
|
{
|
|
return $this->userOrganization;
|
|
}
|
|
|
|
public function setUserOrganization(?UsersOrganizations $userOrganization): static
|
|
{
|
|
$this->userOrganization = $userOrganization;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getApplication(): ?Apps
|
|
{
|
|
return $this->application;
|
|
}
|
|
|
|
public function setApplication(?Apps $application): static
|
|
{
|
|
$this->application = $application;
|
|
|
|
return $this;
|
|
}
|
|
}
|