<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\SoftDeleteable\Traits\SoftDeleteableEntity;
/**
* EventContact
*
* @ORM\Table(name="event_contact")
* @ORM\Entity(repositoryClass="App\Repository\EventContactRepository")
*/
class EventContact implements EntityInterface
{
use \Gedmo\Timestampable\Traits\TimestampableEntity;
use BlameableEntity;
use SoftDeleteableEntity;
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
* @ORM\Column(name="status", type="string", length=20, nullable=true)
*/
private $status = EntityInterface::STATUS_DISABLED;
/**
* @var string
* @ORM\Column(name="first_name", type="string",length=255, nullable=true)
*/
private $firstName;
/**
* @var string
* @ORM\Column(name="last_name", type="string", length=255, nullable=true)
*/
private $lastName;
/**
* @var string
* @ORM\Column(name="email", type="string", length=255, nullable=true)
*/
private $email;
/**
* @var string
* @ORM\Column(name="phone", type="string", length=255, nullable=true)
*/
private $phone;
/**
* @var string
* @ORM\Column(name="event_email", type="string", length=255, nullable=true)
*/
private $eventEmail;
/**
* @var string
* @ORM\Column(name="event_phone", type="string", length=255, nullable=true)
*/
private $eventPhone;
/**
* @var string
* @ORM\Column(name="event_role", type="string", length=255, nullable=true)
*/
private $eventRole;
/**
* @var string
* @ORM\Column(name="organization_code", type="string", length=255, nullable=true)
*/
private $organizationCode;
/**
* @var string
* @ORM\Column(name="organization_name", type="string", length=255, nullable=true)
*/
private $organizationName;
/**
* @var EventGroupContactsHost $groupContactsHost
* @ORM\ManyToOne(targetEntity="EventGroupContactsHost", inversedBy="contacts", cascade={"persist"})
* @ORM\JoinColumn(name="group_contacts_host_id", referencedColumnName="id")
*/
private $groupContactsHost;
/**
* @var EventGroupContactsRights $groupContactsRights
* @ORM\ManyToOne(targetEntity="EventGroupContactsRights", inversedBy="contacts", cascade={"persist"})
* @ORM\JoinColumn(name="group_contacts_rights_id", referencedColumnName="id")
*/
private $groupContactsRights;
/**
* @var EventGroupContactsOthers $groupContactsOthers
* @ORM\ManyToOne(targetEntity="EventGroupContactsOthers", inversedBy="contacts", cascade={"persist"})
* @ORM\JoinColumn(name="group_contacts_others_id", referencedColumnName="id")
*/
private $groupContactsOthers;
/**
* @var EventGroupContactsAccreditation $groupContactsAccreditation
* @ORM\ManyToOne(targetEntity="EventGroupContactsAccreditation", inversedBy="contacts", cascade={"persist"})
* @ORM\JoinColumn(name="group_contacts_accreditation_id", referencedColumnName="id")
*/
private $groupContactsAccreditation;
/**
* @var EventGroupContactsOnSite $groupContactsOnSite
* @ORM\ManyToOne(targetEntity="EventGroupContactsOnSite", inversedBy="contacts", cascade={"persist"})
* @ORM\JoinColumn(name="group_contacts_onsite_id", referencedColumnName="id")
*/
private $groupContactsOnSite;
/**
* @return EventGroupContactsOnSite
*/
public function getGroupContactsOnSite(): EventGroupContactsOnSite
{
return $this->groupContactsOnSite;
}
/**
* @param EventGroupContactsOnSite $groupContactsOnSite
*/
public function setGroupContactsOnSite(EventGroupContactsOnSite $groupContactsOnSite): void
{
$this->groupContactsOnSite = $groupContactsOnSite;
}
/**
* @return EventGroupContactsAccreditation
*/
public function getGroupContactsAccreditation(): ?EventGroupContactsAccreditation
{
return $this->groupContactsAccreditation;
}
/**
* @param EventGroupContactsAccreditation $groupContactsAccreditation
*/
public function setGroupContactsAccreditation(EventGroupContactsAccreditation $groupContactsAccreditation = null): void
{
$this->groupContactsAccreditation = $groupContactsAccreditation;
}
/**
* @return mixed
*/
public function getGroupContactsRights(): ?EventGroupContactsRights
{
return $this->groupContactsRights;
}
/**
* @param mixed $groupContactsRights
*/
public function setGroupContactsRights(EventGroupContactsRights $groupContactsRights = null): void
{
$this->groupContactsRights = $groupContactsRights;
}
/**
* @param mixed $groupContactsOthers
*/
public function setGroupContactsOthers(EventGroupContactsOthers $groupContactsOthers = null): void
{
$this->groupContactsOthers = $groupContactsOthers;
}
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @param int $id
*/
public function setId(int $id)
{
$this->id = $id;
}
/**
* @return string
*/
public function getPhone(): ?string
{
return $this->phone;
}
/**
* @param string $phone
*/
public function setPhone(string $phone = null)
{
$this->phone = $phone;
}
public function isActivated(): bool
{
return $this->status === EntityInterface::STATUS_ACTIVE;
}
/**
* @return string
*/
public function getEventEmail(): ?string
{
return $this->eventEmail;
}
/**
* @param string $eventEmail
*/
public function setEventEmail(string $eventEmail = null)
{
$this->eventEmail = $eventEmail;
}
/**
* @return string
*/
public function getEventPhone(): ?string
{
return $this->eventPhone;
}
/**
* @param string $eventPhone
*/
public function setEventPhone(string $eventPhone = null)
{
$this->eventPhone = $eventPhone;
}
/**
* @return string
*/
public function getEventRole(): ?string
{
return $this->eventRole;
}
/**
* @param string $eventRole
*/
public function setEventRole(string $eventRole = null)
{
$this->eventRole = $eventRole;
}
/**
* @return string
*/
public function getOrganizationCode(): ?string
{
return $this->organizationCode;
}
/**
* @param string $organizationCode
*/
public function setOrganizationCode(string $organizationCode = null)
{
$this->organizationCode = $organizationCode;
}
/**
* @return string
*/
public function getOrganizationName(): ?string
{
return $this->organizationName;
}
/**
* @param string $organizationName
*/
public function setOrganizationName(string $organizationName = null)
{
$this->organizationName = $organizationName;
}
/**
* @return mixed
*/
public function getGroupContactsHost(): ?EventGroupContactsHost
{
return $this->groupContactsHost;
}
/**
* @param mixed $groupContactsHost
*/
public function setGroupContactsHost(EventGroupContactsHost $groupContactsHost): void
{
$this->groupContactsHost = $groupContactsHost;
}
public function toString(): string
{
return "{id=" . $this->id . "}";
}
public function __toString()
{
return $this->getDisplayName();
}
public function getDisplayName(): string
{
$res = '';
if ($this->getFirstName() != null) {
$res = $this->getFirstName();
}
if ($this->getLastName() != null) {
$res = ' ' . $this->getLastName();
}
$res = trim($res);
if ($this->getEmail() != null) {
if ($res == '') {
$res = $this->getEmail();
} else {
$res = $res . ' [' . $this->getEmail() . ']';
}
}
return $res;
}
/**
* @return string
*/
public function getFirstName(): ?string
{
return $this->firstName;
}
/**
* @param string $firstName
*/
public function setFirstName(string $firstName = null)
{
$this->firstName = $firstName;
}
/**
* @return string
*/
public function getLastName(): ?string
{
return $this->lastName;
}
/**
* @param string $lastName
*/
public function setLastName(string $lastName = null)
{
$this->lastName = $lastName;
}
/**
* @return string
*/
public function getEmail(): ?string
{
return $this->email;
}
/**
* @param string $email
*/
public function setEmail(string $email = null)
{
$this->email = $email;
}
public function getKey()
{
return $this->buildKey($this->getFirstName(), $this->getLastName(), $this->getEmail());
}
/**
* @param $initFirstName
* @param $initLastName
* @param $initEmail
* @return string
*/
public static function buildKey(
string $initFirstName = null,
string $initLastName = null,
string $initEmail = null
): string
{
$firstName = empty(trim($initFirstName)) ? "null" : $initFirstName;
$lastName = empty(trim($initLastName)) ? "null" : $initLastName;
$email = empty(trim($initEmail)) ? "null" : $initEmail;
return $firstName . ' - ' . $lastName . ' - ' . $email;
}
/**
* @return string
*/
public function getStatus(): string
{
return $this->status;
}
/**
* @param string $status
*/
public function setStatus(string $status)
{
$this->status = $status;
}
}