<?php
namespace App\Entity\ChannelUserData\Cursus;
use Nellapp\Bundle\SDKBundle\TrackData\Attribute\TrackEntity;
use Nellapp\Bundle\SDKBundle\TrackData\Attribute\TrackFIeld;
use App\Enum\ChannelUserData\Activity\CursusActivityTagEnum;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
#[
ORM\Entity,
ORM\Table(name: 'channel_user_data_cursus_founder_adviser'),
TrackEntity(
name: 'adviser.entity.track_data.entity.name',
fieldGroups: [
'adviser' => [
'tags' => [ CursusActivityTagEnum::FOUNDING ]
]
],
),
]
class Adviser
{
#[ORM\Id, ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private ?int $id = null;
#[ORM\OneToOne(inversedBy: 'adviser', targetEntity: Founder::class)]
#[ORM\JoinColumn(name: 'founder_id', nullable: false, onDelete: 'CASCADE')]
private ?Founder $founder = null;
#[ORM\Column(type: 'string', nullable: true)]
#[Assert\NotBlank(groups: ['Default'])]
#[TrackFIeld(name: 'adviser.entity.firstName.label', fieldKey: 'adviser')]
private ?string $firstName = null;
#[ORM\Column(type: 'string', nullable: true)]
#[Assert\NotBlank(groups: ['Default'])]
#[TrackFIeld(name: 'adviser.entity.lastName.label', fieldKey: 'adviser')]
private ?string $lastName = null;
#[ORM\Column(type: 'string', nullable: true)]
#[
Assert\NotBlank(groups: ['Default']),
Assert\Email(message: 'adviser.entity.email.Email.message', mode: 'strict', groups: ['Default'])
]
#[TrackFIeld(name: 'adviser.entity.email.label', fieldKey: 'adviser')]
private ?string $email = null;
#[ORM\Column(type: 'string', nullable: true)]
#[
Assert\Length(exactly: 10, exactMessage: 'adviser.entity.phone.Length.message', groups: ['Default'])
]
#[TrackFIeld(name: 'adviser.entity.phone.label', fieldKey: 'adviser')]
private ?string $phone = null;
public function __toString(): string
{
return $this->getFirstName() . ' ' . $this->getLastName();
}
public function getFirstName(): ?string
{
return $this->firstName;
}
public function setFirstName(?string $firstName): Adviser
{
$this->firstName = $firstName;
return $this;
}
public function getLastName(): ?string
{
return $this->lastName;
}
public function setLastName(?string $lastName): Adviser
{
$this->lastName = $lastName;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): Adviser
{
$this->email = $email;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(?string $phone): Adviser
{
$this->phone = $phone;
return $this;
}
public function getId(): ?int
{
return $this->id;
}
public function getFounder(): ?Founder
{
return $this->founder;
}
public function setFounder(?Founder $founder): Adviser
{
$this->founder = $founder;
return $this;
}
}