<?php
namespace App\Entity;
use App\Repository\FilmProjectMemberRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: FilmProjectMemberRepository::class)]
class FilmProjectMember
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $name;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $role;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $address;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $state;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $postcode;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $organisation;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $telephone;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $email;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $gender;
#[ORM\Column(type: 'boolean', nullable: true)]
private $isLingualDiverse;
#[ORM\Column(type: 'boolean', nullable: true)]
private $isIslanderOrigin;
#[ORM\ManyToOne(targetEntity: FilmProject::class, inversedBy: 'filmProjectMembers')]
private $filmProject;
#[ORM\Column(type: 'text', nullable: true)]
private $biography;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $website;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $salesforceId;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $accountSalesforceId;
#[ORM\Column(type: 'boolean', nullable: true)]
private $isActive;
#[ORM\Column(type: 'boolean', nullable: true)]
private $isSent;
#[ORM\OneToOne(inversedBy: 'filmProjectAdmin', targetEntity: FilmProject::class, cascade: ['persist', 'remove'])]
private $adminFilmProject;
#[ORM\OneToOne(inversedBy: 'filmProjectProducer', targetEntity: FilmProject::class, cascade: ['persist', 'remove'])]
private $producerFilmProject;
#[ORM\OneToOne(inversedBy: 'filmProjectDirector', targetEntity: FilmProject::class, cascade: ['persist', 'remove'])]
private $directorFilmProject;
#[ORM\Column(length: 255, nullable: true)]
private ?string $lastName = null;
#[ORM\Column(nullable: true)]
private ?int $wordpressId = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $city = null;
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getRole(): ?string
{
return $this->role;
}
public function setRole(string $role): self
{
$this->role = $role;
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(string $address): self
{
$this->address = $address;
return $this;
}
public function getState(): ?string
{
return $this->state;
}
public function setState(string $state): self
{
$this->state = $state;
return $this;
}
public function getPostcode(): ?string
{
return $this->postcode;
}
public function setPostcode(string $postcode): self
{
$this->postcode = $postcode;
return $this;
}
public function getOrganisation(): ?string
{
return $this->organisation;
}
public function setOrganisation(string $organisation): self
{
$this->organisation = $organisation;
return $this;
}
public function getTelephone(): ?string
{
return $this->telephone;
}
public function setTelephone(string $telephone): self
{
$this->telephone = $telephone;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function getGender(): ?string
{
return $this->gender;
}
public function setGender(string $gender): self
{
$this->gender = $gender;
return $this;
}
public function isIsLingualDiverse(): ?bool
{
return $this->isLingualDiverse;
}
public function setIsLingualDiverse(?bool $isLingualDiverse): self
{
$this->isLingualDiverse = $isLingualDiverse;
return $this;
}
public function isIsIslanderOrigin(): ?bool
{
return $this->isIslanderOrigin;
}
public function setIsIslanderOrigin(?bool $isIslanderOrigin): self
{
$this->isIslanderOrigin = $isIslanderOrigin;
return $this;
}
public function getFilmProject(): ?FilmProject
{
return $this->filmProject;
}
public function setFilmProject(?FilmProject $filmProject): self
{
$this->filmProject = $filmProject;
return $this;
}
public function toString()
{
$string = 'Film Project Member';
if ($this->name) {
$string = $this->name . ' ' . $this->lastName;
}
return $string;
}
public function __toString()
{
return $this->toString();
}
public function getBiography(): ?string
{
return $this->biography;
}
public function setBiography(?string $biography): self
{
$this->biography = $biography;
return $this;
}
public function getWebsite(): ?string
{
return $this->website;
}
public function setWebsite(?string $website): self
{
$this->website = $website;
return $this;
}
public function getSalesforceId(): ?string
{
return $this->salesforceId;
}
public function setSalesforceId(?string $salesforceId): self
{
$this->salesforceId = $salesforceId;
return $this;
}
public function getAccountSalesforceId(): ?string
{
return $this->accountSalesforceId;
}
public function setAccountSalesforceId(?string $accountSalesforceId): self
{
$this->accountSalesforceId = $accountSalesforceId;
return $this;
}
public function isIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(?bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
public function approveInvitation(): self
{
$this->isActive = true;
return $this;
}
public function declineInvitation(): self
{
$this->isActive = false;
return $this;
}
public function isIsSent(): ?bool
{
return $this->isSent;
}
public function setIsSent(?bool $isSent): self
{
$this->isSent = $isSent;
return $this;
}
public function approveSentEmail(): self
{
$this->setIsSent(true);
return $this;
}
public function getAdminFilmProject(): ?FilmProject
{
return $this->adminFilmProject;
}
public function setAdminFilmProject(?FilmProject $filmProject): self
{
$this->adminFilmProject = $filmProject;
return $this;
}
public function getProducerFilmProject(): ?FilmProject
{
return $this->producerFilmProject;
}
public function setProducerFilmProject(?FilmProject $filmProject): self
{
$this->producerFilmProject = $filmProject;
return $this;
}
public function getDirectorFilmProject(): ?FilmProject
{
return $this->directorFilmProject;
}
public function setDirectorFilmProject(?FilmProject $filmProject): self
{
$this->directorFilmProject = $filmProject;
return $this;
}
public function getMainProject(): ?FilmProject
{
$project = null;
if ($this->role) {
switch($this->role) {
case 'Administrator':
$project = $this->adminFilmProject;
break;
case 'Director':
$project = $this->directorFilmProject;
if (empty($project)) {
$project= $this->filmProject;
}
break;
case 'Producer':
$project = $this->producerFilmProject;
if (empty($project)) {
$project= $this->filmProject;
}
break;
default:
$project = $this->filmProject;
break;
}
}
return $project;
}
public function getLastName(): ?string
{
return $this->lastName;
}
public function setLastName(?string $lastName): self
{
$this->lastName = $lastName;
return $this;
}
public function getFullName(): ?string
{
if ($this->lastName) {
return $this->name . ' ' . $this->lastName;
}
return $this->name;
}
public function getWordpressId(): ?int
{
return $this->wordpressId;
}
public function setWordpressId(?int $wordpressId): self
{
$this->wordpressId = $wordpressId;
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(?string $city): self
{
$this->city = $city;
return $this;
}
}