<?php
namespace App\Entity;
use App\Enum\NotificationType;
use App\Repository\UserRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Uid\Uuid;
use Misd\PhoneNumberBundle\Validator\Constraints\PhoneNumber as AssertPhoneNumber;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use SymfonyCasts\Bundle\ResetPassword\Model\ResetPasswordToken;
#[ORM\Entity(repositoryClass: UserRepository::class)]
#[ORM\Table(name: 'users')]
#[UniqueEntity(fields: ['email'], message: 'Cette adresse email est déjà utilisée par un autre compte')]
/**
* @Vich\Uploadable()
*/
class User implements UserInterface, PasswordAuthenticatedUserInterface
{
#[ORM\Id]
#[ORM\Column(type: 'string', length: 22, unique: true)]
#[Groups(['campaign', 'user_read','mission_list', 'mission_read', 'mission_participant_write', 'message_write','message_read','user_directory'])]
private string $id;
#[ORM\Column(type: 'string', length: 180, nullable: true)]
// #[Assert\NotBlank(message: 'Ce champs est requis')]
#[Groups(['user_read', 'mission_read','mission_list', 'mission_participant_write','message_read', 'message_write','user_directory'])]
private ?string $firstname = null;
#[ORM\Column(type: 'boolean', nullable: true)]
private ?bool $newAdd = false;
#[ORM\Column(type: 'boolean', nullable: true)]
private ?bool $allCompany = false;
#[ORM\Column(type: 'boolean', nullable: true)]
#[Groups(['mission_list','mission_read','message_read','user_read'])]
private ?bool $salary = false;
#[ORM\Column(type: 'boolean', nullable: true)]
private ?bool $manager = false;
#[ORM\Column(type: 'boolean', nullable: true)]
private ?bool $partner = false;
#[ORM\Column(type: 'boolean', nullable: true)]
#[Groups(['mission_list','mission_read','message_read','user_read'])]
private ?bool $shareMyEmail = false;
#[ORM\Column(type: 'boolean', nullable: true)]
#[Groups(['mission_list','mission_read','message_read','user_read'])]
private ?bool $shareMyPhone = false;
#[ORM\Column(type: 'string', length: 180, nullable: true)]
// #[Assert\NotBlank(message: 'Ce champs est requis')]
#[Groups(['user_read', 'mission_read','mission_list','message_read', 'mission_participant_write', 'message_write','user_directory'])]
private ?string $lastname = null;
#[ORM\Column(type: 'string', nullable: true)]
#[Groups(['user_read', 'mission_read','mission_list','message_read', 'mission_participant_write'])]
private ?string $cellPhone = null;
#[ORM\Column(type: 'boolean', nullable: true)]
#[Groups(['mission_list','user_read', 'mission_read','message_read', 'mission_participant_write'])]
private ?bool $enabled = false;
#[ORM\Column(type: 'boolean', nullable: true)]
private ?bool $external = false;
#[ORM\Column(type: 'decimal', precision: 10, scale: 2, nullable: true)]
#[Groups(['mission_list','user_read','message_read','mission_read'])]
private ?float $dailyRate = null;
#[ORM\Column(type: 'decimal', precision: 10, scale: 2, nullable: true)]
#[Groups(['mission_list','user_read','message_read','mission_read'])]
private ?float $resaleRate = null;
#[ORM\Column(type: 'smallint', nullable: true)]
private ?int $billingMethod = 0;
/**
* @Vich\UploadableField(mapping="sub_contractor_image", fileNameProperty="pictureName")
*/
#[Assert\File(mimeTypes: ['image/png', 'image/jpeg', 'image/jpg','image/webp'], mimeTypesMessage: 'Les formats supportés sont : PNG, JPEG, JPG')]
private ?File $picture = null;
#[ORM\Column(type: 'string', nullable: true)]
#[Groups(['mission_list','user_read', 'mission_read','message_read','user_directory'])]
private ?string $pictureName = null;
#[ORM\Column(type: 'datetime', nullable: true)]
#[Groups(['mission_list','user_read','message_read'])]
private ?\DateTimeInterface $updatedAt = null;
#[ORM\Column(type: 'string', length: 180, unique: true)]
#[Assert\NotBlank(message: 'Ce champ est requis')]
// #[Assert\Email(message: 'Cette adresse n\'est pas valide')]
#[Groups(['mission_list','user_read', 'mission_read','message_read', 'mission_participant_write'])]
private string $email = '';
#[ORM\Column(type: 'string', length: 180, nullable: true)]
private $OriginalEmail ;
#[ORM\Column(type: 'json')]
#[Groups(['user_read'])]
private array $roles = [];
#[ORM\Column(type: 'string')]
private string $password = '';
#[Assert\Length(min: 8, minMessage: 'Le mot de passe doit faire 8 charactères minimum')]
#[Assert\NotCompromisedPassword(message: 'Votre mot de passe est trop faible, merci d\'en choisir un plus fort', threshold: 50000)]
private ?string $plainPassword = null;
#[ORM\Column(type: 'datetime', nullable: true)]
private ?\DateTimeInterface $createdAt;
#[ORM\Column(type: 'datetime', nullable: true)]
private ?\DateTimeInterface $lastConnectionAt = null;
#[ORM\Column(type: 'string', nullable: true)]
private ?string $accountType;
#[ORM\ManyToOne(targetEntity: Company::class, inversedBy: 'users')]
#[Groups(['user_read','message_read'])]
private ?Company $company;
#[ORM\ManyToMany(inversedBy: 'otherUser',targetEntity: Company::class)]
private $otherCompany;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: Message::class)]
private $messages;
#[ORM\OneToOne(targetEntity: UserData::class, cascade: ['persist', 'remove'])]
private ?UserData $userData;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: FileMission::class)]
private $fileMissions;
#[ORM\ManyToMany(mappedBy: 'user', targetEntity: WorkflowAction::class)]
private $workflowAction;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: InfoMission::class)]
private $infoMissions;
#[ORM\OneToMany(mappedBy: 'contact', targetEntity: Mission::class)]
private $missions;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: Historique::class)]
private $historiques;
#[ORM\OneToMany(mappedBy: 'orderedBy', targetEntity: CreditHistory::class)]
private $creditHistories;
#[ORM\OneToMany(mappedBy: 'orderedBy', targetEntity: Campaign::class)]
private $campaigns;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: SubContractorCompany::class, cascade: ["persist"])]
private $subContractorCompanies;
#[ORM\Column(type: 'json', nullable: true)]
#[Groups(['user_read'])]
private ?array $notificationType = [0,1,2];
#[ORM\Column(type: 'json', nullable: true)]
#[Groups(['user_read'])]
private ?array $notification = [0,1,2,3,4,5];
#[ORM\Column(type: 'json', nullable: true)]
#[Groups(['user_read'])]
private $freqNotification = [1];
#[ORM\Column(type: 'json', nullable: true)]
#[Groups(['user_read'])]
private $freqNotificationEverytime = [1,3,5,8];
#[ORM\Column(type: 'json', nullable: true)]
#[Groups(['user_read'])]
private $freqNotificationPerDay = [0,2];
#[ORM\Column(type: 'json', nullable: true)]
#[Groups(['user_read'])]
private $freqNotificationPerWeek = [6];
#[ORM\Column(type: 'json', nullable: true)]
#[Groups(['user_read'])]
private $freqNotificationPerMonth = [];
#[ORM\OneToMany(mappedBy: 'user', targetEntity: Device::class)]
private $devices;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: Service::class)]
#[Groups(['user_read'])]
private $services;
#[ORM\ManyToMany(targetEntity: Job::class, mappedBy: 'user')]
#[Groups(['user_directory','user_read'])]
private $jobs;
#[ORM\Column(type: 'boolean', options: ['default' => false])]
private ?bool $isActiveNotification = false;
#[ORM\Column(type: 'boolean')]
#[Groups(['mission_list','user_read', 'mission_read', 'mission_participant_write'])]
private ?bool $deleted = false;
#[ORM\Column(type: 'boolean')]
private ?bool $referencingConfirmationNotification = false;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
#[Groups(['user_read'])]
private $gender;
#[ORM\OneToMany(mappedBy: 'orderBy', targetEntity: BalanceTransactions::class)]
private $balanceTransactions;
#[ORM\Column(type: 'array', nullable: true)]
private $deviceConnectedList = [];
#[ORM\Column]
private ?bool $invisible = null;
#[ORM\Column(nullable: true)]
private ?\DateTimeImmutable $lastActivityAt = null;
#[ORM\Column(nullable: true)]
private ?bool $isLogged = null;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: MessageReaction::class)]
private Collection $messageReactions;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: Emoji::class)]
private Collection $emoji;
#[ORM\OneToMany(mappedBy: 'orderedBy', targetEntity: CommandeLogging::class)]
private $commandeLoggings;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: Support::class, orphanRemoval: true,cascade: ["persist"])]
private $supports;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: ConfidentialityContract::class)]
private Collection $confidentialityContracts;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: CampaignPendingToSend::class)]
private $campaignPendingToSends;
private $resetToken = null;
#[ORM\Column(type: 'boolean', nullable: true)]
private $isNewClient;
#[ORM\Column(type: 'datetime_immutable', nullable: true)]
private $autorizationDateAt;
#[ORM\Column(type: 'boolean', nullable: true)]
private $acceptPresentation;
#[ORM\Column(type: 'text', nullable: true)]
#[Groups(['user_directory'])]
private $description;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
#[Groups(['user_directory'])]
private $title;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $oneTimeLoginToken;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $state;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: Portfolio::class)]
#[Groups(['user_directory'])]
private $portfolio;
#[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'children',cascade: ["persist"])]
private $parent;
#[ORM\OneToMany(mappedBy: 'parent', targetEntity: User::class,cascade: ["persist"])]
private $children;
#[ORM\OneToMany(mappedBy: 'user', targetEntity: SignedContract::class)]
private $signedContracts;
#[ORM\OneToMany(mappedBy: 'representative', targetEntity: Company::class)]
private $companiesRepresentative;
private $originalEmail = "";
#[ORM\OneToMany(mappedBy: 'createdBy', targetEntity: Product::class)]
private $products;
#[ORM\ManyToMany(targetEntity: WorkflowStep::class, mappedBy: 'userResponsable')]
private $workflowSteps;
//only for API
#[Groups(['user_read'])]
private $listAccount;
#[Groups(['user_read'])]
private $originalMailUser = "";
#[Groups(['user_read'])]
private $roleName ="";
#[Groups(['user_read'])]
private $lastActivityInMinute = 99999;
///////
private $fullName;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
#[Groups(['message_read', 'mission_read', 'message_write'])]
private $identifier;
#[ORM\OneToMany(mappedBy: 'createdBy', targetEntity: SharedResourcesCategory::class)]
private Collection $sharedResourcesCategories;
#[ORM\OneToMany(mappedBy: 'createdBy', targetEntity: CompanyResource::class)]
private Collection $companyResources;
#[ORM\OneToMany(mappedBy: 'createdBy', targetEntity: ResourceDeliverableHistory::class)]
private Collection $resourceDeliverableHistories;
#[ORM\OneToMany(mappedBy: 'createdBy', targetEntity: FilesResourceDeliverableHistory::class)]
private Collection $filesResourceDeliverableHistories;
#[ORM\ManyToMany(targetEntity: FilePermissions::class, mappedBy: 'user')]
private Collection $filePermissions;
#[ORM\ManyToMany(targetEntity: FolderPermissions::class, mappedBy: 'user')]
private Collection $folderPermissions;
#[ORM\OneToMany(mappedBy: 'createdBy', targetEntity: FolderPermissions::class)]
private Collection $folderPermissionsCreatedBy;
#[ORM\OneToMany(mappedBy: 'createdBy', targetEntity: FilePermissions::class)]
private Collection $filePermissionsCreatedBy;
public function __construct()
{
$this->id = Uuid::v4()->toBase58();
$this->createdAt = new \DateTime('now');
$this->messages = new ArrayCollection();
$this->infoMissions = new ArrayCollection();
$this->missions = new ArrayCollection();
$this->historiques = new ArrayCollection();
$this->creditHistories = new ArrayCollection();
$this->campaigns = new ArrayCollection();
$this->subContractorCompanies = new ArrayCollection();
$this->devices = new ArrayCollection();
$this->services = new ArrayCollection();
$this->jobs = new ArrayCollection();
$this->balanceTransactions = new ArrayCollection();
$this->invisible = false;
$this->company = null;
$this->dailyRate = 0;
$this->resaleRate = 0;
$this->workflowAction = new ArrayCollection();
$this->messageReactions = new ArrayCollection();
$this->emoji = new ArrayCollection();
$this->commandeLoggings = new ArrayCollection();
$this->supports = new ArrayCollection();
$this->confidentialityContracts = new ArrayCollection();
$this->campaignPendingToSends = new ArrayCollection();
$this->fileMissions = new ArrayCollection();
$this->isNewClient = false;
$this->autorizationDateAt = new \DateTimeImmutable();
$this->state = 'enabled';
$this->portfolio = new ArrayCollection();
$this->otherCompany = new ArrayCollection();
$this->children = new ArrayCollection();
$this->signedContracts = new ArrayCollection();
$this->companiesRepresentative = new ArrayCollection();
$this->products = new ArrayCollection();
$this->workflowSteps = new ArrayCollection();
$this->sharedResourcesCategories = new ArrayCollection();
$this->companyResources = new ArrayCollection();
$this->resourceDeliverableHistories = new ArrayCollection();
$this->filesResourceDeliverableHistories = new ArrayCollection();
$this->filePermissions = new ArrayCollection();
$this->folderPermissions = new ArrayCollection();
$this->folderPermissionsCreatedBy = new ArrayCollection();
$this->filePermissionsCreatedBy = new ArrayCollection();
}
public function getId(): ?string
{
return $this->id;
}
public function setId($id){
$this->id = $id;
return $this;
}
public function __toString(): string
{
return $this->getFirstname().' '.$this->getLastname();
}
public function getEmail(): ?string
{
if ($this->getOriginalEmail() != null) {
return $this->getOriginalEmail();
}
return $this->email;
}
public function getOriginalMailUser(): ?string
{
return $this->email;
}
// public function getOriginalEmail(): ?string
// {
// return $this->email;
// }
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
/**
* A visual identifier that represents this user.
*
* @see UserInterface
*/
public function getUserIdentifier(): string
{
return (string) $this->email;
}
/**
* @deprecated since Symfony 5.3, use getUserIdentifier instead
*/
public function getUsername(): string
{
return (string) $this->email;
}
/**
* @see UserInterface
*/
public function getRoles(): array
{
$roles = $this->roles;
// if (isset($_SESSION['_sf2_attributes']['role_current_user']) and null !== $_SESSION['_sf2_attributes']['role_current_user']) {
// $roles[0]= $_SESSION['_sf2_attributes']['role_current_user'];
// }
// $roles[0]='ROLE_MANAGER';
// guarantee every user at least has ROLE_USER
$roles[] = 'ROLE_USER';
return array_unique($roles);
}
public function getOriginalRoles(): array
{
$roles = $this->roles;
// $roles[0]='ROLE_MANAGER';
// guarantee every user at least has ROLE_USER
$roles[] = 'ROLE_USER';
return array_unique($roles);
}
public function setRoles(array $roles): self
{
$this->roles = $roles;
return $this;
}
/**
* @see PasswordAuthenticatedUserInterface
*/
public function getPassword(): string
{
return $this->password;
}
public function setPassword(string $password): self
{
$this->password = $password;
return $this;
}
/**
* Returning a salt is only needed, if you are not using a modern
* hashing algorithm (e.g. bcrypt or sodium) in your security.yaml.
*
* @see UserInterface
*/
public function getSalt(): ?string
{
return null;
}
/**
* @see UserInterface
*/
public function eraseCredentials()
{
// If you store any temporary, sensitive data on the user, clear it here
// $this->plainPassword = null;
}
/**
* @return string|null
*/
public function getFirstname(): ?string
{
return $this->firstname;
}
/**
* @param mixed $firstname
*/
public function setFirstname(?string $firstname): self
{
$this->firstname = $firstname;
return $this;
}
/**
* @return string|null
*/
public function getLastname(): ?string
{
return $this->lastname;
}
/**
* @param mixed $lastname
*/
public function setLastname(?string $lastname): self
{
$this->lastname = $lastname;
return $this;
}
/**
* @return string|null
*/
public function getCellPhone(): ?string
{
return $this->cellPhone;
}
/**
* @param mixed $cellPhone
*/
public function setCellPhone(?string $cellPhone): self
{
$this->cellPhone = $cellPhone;
return $this;
}
/**
* @return bool
*/
public function isEnabled(): bool
{
return $this->enabled;
}
/**
* @param int $enabled
*/
public function setEnabled(bool $enabled): self
{
if (is_null($this->getParent()) and $enabled) {
foreach ($this->getChildren() as $userChild) {
$userChild->setEnabled($enabled);
}
}
$this->enabled = $enabled;
return $this;
}
/**
* @return bool|null
*/
public function isExternal(): ?bool
{
return $this->external;
}
/**
* @param int $external
*/
public function setExternal(bool $external): self
{
$this->external = $external;
return $this;
}
/**
* @return mixed
*/
public function getDailyRate(): ?string
{
return $this->dailyRate;
}
/**
* @param mixed $dailyRate
*/
public function setDailyRate(?string $dailyRate): void
{
$this->dailyRate = $dailyRate;
}
/**
* @return mixed
*/
public function getBillingMethod(): ?string
{
return $this->billingMethod;
}
/**
* @param mixed $billingMethod
*/
public function setBillingMethod(?string $billingMethod): void
{
$this->billingMethod = $billingMethod;
}
public function serialize()
{
$this->picture = base64_encode($this->picture);
}
public function unserialize($serialized)
{
$this->picture = base64_decode($this->picture);
}
/**
* @return File|null
*/
public function getPicture(): ?File
{
return $this->picture;
}
public function setPicture(?File $picture = null): void
{
$this->picture = $picture;
if (null !== $picture) {
// It is required that at least one field changes if you are using doctrine
// otherwise the event listeners won't be called and the file is lost
$this->updatedAt = new \DateTimeImmutable();
}
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* @return string|null
*/
public function getPictureName(): ?string
{
return $this->pictureName;
}
/**
* @param string|null $pictureName
*/
public function setPictureName(?string $pictureName): void
{
$this->pictureName = $pictureName;
}
/**
* @return \DateTimeInterface|null
*/
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
/**
* @param \DateTimeInterface|null $createdAt
*/
public function setCreatedAt(?\DateTimeInterface $createdAt): void
{
$this->createdAt = $createdAt;
}
/**
* @return \DateTimeInterface|null
*/
public function getLastConnectionAt(): ?\DateTimeInterface
{
return $this->lastConnectionAt;
}
/**
* @param \DateTimeInterface|null $lastConnectionAt
* @return User
*/
public function setLastConnectionAt(?\DateTimeInterface $lastConnectionAt): User
{
$this->lastConnectionAt = $lastConnectionAt;
return $this;
}
public function getPlainPassword(): ?string
{
return $this->plainPassword;
}
public function setPlainPassword(?string $password): self
{
$this->plainPassword = $password;
return $this;
}
/**
* @return string|null
*/
public function getAccountType(): ?string
{
return $this->accountType;
}
/**
* @param string|null $accountType
* @return User
*/
public function setAccountType(?string $accountType): User
{
$this->accountType = $accountType;
return $this;
}
public function getCompany(): ?Company
{
return $this->company;
}
public function setCompany(?Company $company): self
{
$this->company = $company;
return $this;
}
/**
* @return Collection|Message[]
*/
public function getMessages(): Collection
{
return $this->messages;
}
public function addMessage(Message $message): self
{
if (!$this->messages->contains($message)) {
$this->messages[] = $message;
$message->setUser($this);
}
return $this;
}
public function removeMessage(Message $message): self
{
if ($this->messages->removeElement($message)) {
// set the owning side to null (unless already changed)
if ($message->getUser() === $this) {
$message->setUser(null);
}
}
return $this;
}
/**
* @return Collection|InfoMission[]
*/
public function getInfoMissions(): Collection
{
return $this->infoMissions;
}
public function addInfoMission(InfoMission $infoMission): self
{
if (!$this->infoMissions->contains($infoMission)) {
$this->infoMissions[] = $infoMission;
$infoMission->setUser($this);
}
return $this;
}
public function removeInfoMission(InfoMission $infoMission): self
{
if ($this->infoMissions->removeElement($infoMission)) {
// set the owning side to null (unless already changed)
if ($infoMission->getUser() === $this) {
$infoMission->setUser(null);
}
}
return $this;
}
/**
* @return Collection|Mission[]
*/
public function getMissions(): Collection
{
return $this->missions;
}
public function addMission(Mission $mission): self
{
if (!$this->missions->contains($mission)) {
$this->missions[] = $mission;
$mission->setContact($this);
}
return $this;
}
public function removeMission(Mission $mission): self
{
if ($this->missions->removeElement($mission)) {
// set the owning side to null (unless already changed)
if ($mission->getContact() === $this) {
$mission->setContact(null);
}
}
return $this;
}
/**
* @return Collection|Historique[]
*/
public function getHistoriques(): Collection
{
return $this->historiques;
}
public function addHistorique(Historique $historique): self
{
if (!$this->historiques->contains($historique)) {
$this->historiques[] = $historique;
$historique->setUser($this);
}
return $this;
}
public function removeHistorique(Historique $historique): self
{
if ($this->historiques->removeElement($historique)) {
// set the owning side to null (unless already changed)
if ($historique->getUser() === $this) {
$historique->setUser(null);
}
}
return $this;
}
/**
* @return Collection|SubContractorCompany[]
*/
public function getSubContractorCompanies(): Collection
{
return $this->subContractorCompanies;
}
public function addSubContractorCompany(SubContractorCompany $subContractorCompany): self
{
if (!$this->subContractorCompanies->contains($subContractorCompany)) {
$this->subContractorCompanies[] = $subContractorCompany;
$subContractorCompany->setUser($this);
}
return $this;
}
public function removeSubContractorCompany(SubContractorCompany $subContractorCompany): self
{
if ($this->subContractorCompanies->removeElement($subContractorCompany)) {
// set the owning side to null (unless already changed)
if ($subContractorCompany->getUser() === $this) {
$subContractorCompany->setUser(null);
}
}
return $this;
}
/**
* @return Collection|Device[]
*/
public function getDevices(): Collection
{
return $this->devices;
}
public function addDevice(Device $device): self
{
if (!$this->devices->contains($device)) {
$this->devices[] = $device;
$device->setUser($this);
}
return $this;
}
public function removeDevice(Device $device): self
{
if ($this->devices->removeElement($device)) {
// set the owning side to null (unless already changed)
if ($device->getUser() === $this) {
$device->setUser(null);
}
}
return $this;
}
/**
* @return Collection|Service[]
*/
public function getServices(): Collection
{
return $this->services;
}
public function addService(Service $service): self
{
if (!$this->services->contains($service)) {
$this->services[] = $service;
$service->setUser($this);
}
return $this;
}
public function removeService(Service $service): self
{
if ($this->services->removeElement($service)) {
// set the owning side to null (unless already changed)
if ($service->getUser() === $this) {
$service->setUser(null);
}
}
return $this;
}
/**
* @return array|null
*/
public function getNotificationType(): ?array
{
return $this->notificationType;
}
/**
* @param array|null $notificationType
*/
public function setNotificationType(?array $notificationType): void
{
$this->notificationType = $notificationType;
}
/**
* @return array|null
*/
public function getNotification(): ?array
{
return $this->notification;
}
/**
* @param array|null $notification
*/
public function setNotification(?array $notification): void
{
$this->notification = $notification;
}
/**
* @return Collection|Job[]
*/
public function getJobs(): Collection
{
return $this->jobs;
}
public function addJob(Job $job): self
{
if (!$this->jobs->contains($job)) {
$this->jobs[] = $job;
$job->addUser($this);
}
return $this;
}
public function removeJob(Job $job): self
{
if ($this->jobs->removeElement($job)) {
$job->removeUser($this);
}
return $this;
}
public function getIsActiveNotification(): ?bool
{
return $this->isActiveNotification;
}
public function setIsActiveNotification(bool $isActiveNotification): self
{
$this->isActiveNotification = $isActiveNotification;
return $this;
}
public function getDeleted(): ?bool
{
return $this->deleted;
}
public function setDeleted(bool $deleted): self
{
$this->deleted = $deleted;
return $this;
}
/**
* @return array|null
*/
public function getFreqNotification(): ?array
{
return $this->freqNotification;
}
/**
* @param int|null $freqNotification
*/
public function setFreqNotification(?array $freqNotification): void
{
$this->freqNotification = $freqNotification;
}
/**
* @return array|null
*/
public function getFreqNotificationEverytime(): ?array
{
return $this->freqNotificationEverytime;
}
/**
* @param int|null $freqNotification
*/
public function setFreqNotificationEverytime(?array $freqNotificationEverytime): void
{
$this->freqNotificationEverytime = $freqNotificationEverytime;
}
/**
* @return array|null
*/
public function getFreqNotificationPerDay(): ?array
{
return $this->freqNotificationPerDay;
}
/**
* @param int|null $freqNotification
*/
public function setFreqNotificationPerDay(?array $freqNotificationPerDay): void
{
$this->freqNotificationPerDay = $freqNotificationPerDay;
}
/**
* @return array|null
*/
public function getFreqNotificationPerWeek(): ?array
{
return $this->freqNotificationPerWeek;
}
/**
* @param int|null $freqNotification
*/
public function setFreqNotificationPerWeek(?array $freqNotificationPerWeek): void
{
$this->freqNotificationPerWeek = $freqNotificationPerWeek;
}
/**
* @return array|null
*/
public function getFreqNotificationPerMonth(): ?array
{
return $this->freqNotificationPerMonth;
}
/**
* @param int|null $freqNotification
*/
public function setFreqNotificationPerMonth(?array $freqNotificationPerMonth): void
{
$this->freqNotificationPerMonth = $freqNotificationPerMonth;
}
/**
* @return float|null
*/
public function getResaleRate(): ?float
{
return $this->resaleRate;
}
/**
* @param float|null $resaleRate
*/
public function setResaleRate(?float $resaleRate): void
{
//mettre 30% si le prix de vente est 0 ou null
if (($this->getResaleRate() == null or $this->getResaleRate() == 0)) {
if ($this->getDailyRate() != null and $this->getDailyRate() > 0) {
$this->resaleRate = $this->getDailyRate() + ($this->getDailyRate() * 0.3);
}else{
$this->resaleRate = $resaleRate;
}
}else{
$this->resaleRate = $resaleRate;
}
}
public function getReferencingConfirmationNotification(): ?bool
{
return $this->referencingConfirmationNotification;
}
public function setReferencingConfirmationNotification(bool $referencingConfirmationNotification): self
{
$this->referencingConfirmationNotification = $referencingConfirmationNotification;
return $this;
}
public function getGender(): ?string
{
return $this->gender;
}
public function setGender(?string $gender): self
{
$this->gender = $gender;
return $this;
}
public function getFullName():?string
{
return $this->getFirstname()." ". $this->getLastname();
}
/**
* @return Collection|BalanceTransactions[]
*/
public function getBalanceTransactions(): Collection
{
return $this->balanceTransactions;
}
public function addBalanceTransaction(BalanceTransactions $balanceTransaction): self
{
if (!$this->balanceTransactions->contains($balanceTransaction)) {
$this->balanceTransactions[] = $balanceTransaction;
$balanceTransaction->setOrderBy($this);
}
return $this;
}
public function removeBalanceTransaction(BalanceTransactions $balanceTransaction): self
{
if ($this->balanceTransactions->removeElement($balanceTransaction)) {
// set the owning side to null (unless already changed)
if ($balanceTransaction->getOrderBy() === $this) {
$balanceTransaction->setOrderBy(null);
}
}
return $this;
}
public function getDeviceConnectedList(): ?array
{
return $this->deviceConnectedList;
}
public function setDeviceConnectedList(?array $deviceConnectedList): self
{
$this->deviceConnectedList = $deviceConnectedList;
return $this;
}
public function isInvisible(): ?bool
{
return $this->invisible;
}
public function setInvisible(bool $invisible): static
{
$this->invisible = $invisible;
return $this;
}
public function getLastActivityAt(): ?\DateTimeImmutable
{
return $this->lastActivityAt;
}
public function setLastActivityAt(?\DateTimeImmutable $lastActivityAt): static
{
$this->lastActivityAt = $lastActivityAt;
return $this;
}
public function getLastActivityInMinute(){
if($this->getLastActivityAt() != null){
$now = new \DateTimeImmutable();
$userLastActivity = $this->getLastActivityAt();
$interval= $now->diff($userLastActivity);
return $interval->days * 24 * 60 + $interval->h * 60 + $interval->i;
}
return 9999;
}
public function isLogged(): ?bool
{
return $this->isLogged;
}
public function setIsLogged(?bool $isLogged): static
{
$this->isLogged = $isLogged;
return $this;
}
public function getEnabled(): ?bool
{
return $this->enabled;
}
public function getExternal(): ?bool
{
return $this->external;
}
public function getInvisible(): ?bool
{
return $this->invisible;
}
public function getIsLogged(): ?bool
{
return $this->isLogged;
}
/**
* @return Collection<int, MessageReaction>
*/
public function getMessageReactions(): Collection
{
return $this->messageReactions;
}
public function addMessageReaction(MessageReaction $messageReaction): static
{
if (!$this->messageReactions->contains($messageReaction)) {
$this->messageReactions->add($messageReaction);
$messageReaction->setUser($this);
}
return $this;
}
public function removeMessageReaction(MessageReaction $messageReaction): static
{
if ($this->messageReactions->removeElement($messageReaction)) {
// set the owning side to null (unless already changed)
if ($messageReaction->getUser() === $this) {
$messageReaction->setUser(null);
}
}
return $this;
}
/**
* @return Collection<int, Emoji>
*/
public function getEmoji(): Collection
{
return $this->emoji;
}
public function addEmoji(Emoji $emoji): static
{
if (!$this->emoji->contains($emoji)) {
$this->emoji->add($emoji);
$emoji->setUser($this);
}
return $this;
}
public function removeEmoji(Emoji $emoji): static
{
if ($this->emoji->removeElement($emoji)) {
// set the owning side to null (unless already changed)
if ($emoji->getUser() === $this) {
$emoji->setUser(null);
}
}
return $this;
}
/**
* @return Collection|WorkflowAction[]
*/
public function getWorkflowAction(): Collection
{
return $this->workflowAction;
}
public function addWorkflowAction(WorkflowAction $workflowAction): self
{
if (!$this->workflowAction->contains($workflowAction)) {
$this->workflowAction[] = $workflowAction;
$workflowAction->setUser($this);
}
return $this;
}
public function removeWorkflowAction(WorkflowAction $workflowAction): self
{
if ($this->workflowAction->removeElement($workflowAction)) {
// set the owning side to null (unless already changed)
if ($workflowAction->getUser() === $this) {
$workflowAction->setUser(null);
}
}
return $this;
}
public function getDefaultEmoji(){
return [
[
"emoji" => "👍️",
"emojiId"=>350,
"detail" => "thumbs up"
],
[
"emoji" => "❤️",
"emojiId"=>153,
"detail" => "red heart"
],
[
"emoji" => "😆",
"emojiId"=>5,
"detail" => "grinning squinting face"
],
[
"emoji" => "😮",
"emojiId"=>86,
"detail" => "face with open mouth"
],
[
"emoji" => "😢",
"emojiId"=>97,
"detail" => "crying face"
],
[
"emoji" => "😡",
"emojiId"=>108,
"detail" => "enraged face"
],
];
}
/**
* @return Collection|CommandeLogging[]
*/
public function getCommandeLoggings(): Collection
{
return $this->commandeLoggings;
}
public function addCommandeLogging(CommandeLogging $commandeLogging): self
{
if (!$this->commandeLoggings->contains($commandeLogging)) {
$this->commandeLoggings[] = $commandeLogging;
$commandeLogging->setUser($this);
}
return $this;
}
public function removeCommandeLogging(CommandeLogging $commandeLogging): self
{
if ($this->commandeLoggings->removeElement($commandeLogging)) {
// set the owning side to null (unless already changed)
if ($commandeLogging->getUser() === $this) {
$commandeLogging->setUser(null);
}
}
return $this;
}
public function getNewAdd(): ?bool
{
return $this->newAdd;
}
public function setNewAdd(?bool $newAdd): self
{
$this->newAdd = $newAdd;
return $this;
}
/**
* @return Collection|CreditHistory[]
*/
public function getCreditHistories(): Collection
{
return $this->creditHistories;
}
public function addCreditHistory(CreditHistory $creditHistory): self
{
if (!$this->creditHistories->contains($creditHistory)) {
$this->creditHistories[] = $creditHistory;
$creditHistory->setOrderedBy($this);
}
return $this;
}
public function removeCreditHistory(CreditHistory $creditHistory): self
{
if ($this->creditHistories->removeElement($creditHistory)) {
// set the owning side to null (unless already changed)
if ($creditHistory->getOrderedBy() === $this) {
$creditHistory->setOrderedBy(null);
}
}
return $this;
}
/**
* @return Collection|Campaign[]
*/
public function getCampaigns(): Collection
{
return $this->campaigns;
}
public function addCampaign(Campaign $campaign): self
{
if (!$this->campaigns->contains($campaign)) {
$this->campaigns[] = $campaign;
$campaign->setOrderedBy($this);
}
return $this;
}
public function removeCampaign(Campaign $campaign): self
{
if ($this->campaigns->removeElement($campaign)) {
// set the owning side to null (unless already changed)
if ($campaign->getOrderedBy() === $this) {
$campaign->setOrderedBy(null);
}
}
return $this;
}
public function getShareMyEmail(): ?bool
{
return $this->shareMyEmail;
}
public function setShareMyEmail(?bool $shareMyEmail): self
{
$this->shareMyEmail = $shareMyEmail;
return $this;
}
public function getShareMyPhone(): ?bool
{
return $this->shareMyPhone;
}
public function setShareMyPhone(?bool $shareMyPhone): self
{
$this->shareMyPhone = $shareMyPhone;
return $this;
}
/**
* @return Collection|Support[]
*/
public function getSupports(): Collection
{
return $this->supports;
}
public function addSupport(Support $support): self
{
if (!$this->supports->contains($support)) {
$this->supports[] = $support;
$support->setUser($this);
}
return $this;
}
public function removeSupport(Support $support): self
{
if ($this->supports->removeElement($support)) {
// set the owning side to null (unless already changed)
if ($support->getUser() === $this) {
$support->setUser(null);
}
}
}
public function getResetToken(): ?ResetPasswordToken
{
return $this->resetToken;
}
public function setResetToken(?ResetPasswordToken $resetToken): self
{
$this->resetToken = $resetToken;
return $this;
}
/**
* @return Collection<int, ConfidentialityContract>
*/
public function getConfidentialityContracts(): Collection
{
return $this->confidentialityContracts;
}
public function addConfidentialityContract(ConfidentialityContract $confidentialityContract): static
{
if (!$this->confidentialityContracts->contains($confidentialityContract)) {
$this->confidentialityContracts->add($confidentialityContract);
$confidentialityContract->setUser($this);
}
return $this;
}
public function removeConfidentialityContract(ConfidentialityContract $confidentialityContract): static
{
if ($this->confidentialityContracts->removeElement($confidentialityContract)) {
// set the owning side to null (unless already changed)
if ($confidentialityContract->getUser() === $this) {
$confidentialityContract->setUser(null);
}
}
return $this;
}
/**
* @return Collection|CampaignPendingToSend[]
*/
public function getCampaignPendingToSends(): Collection
{
return $this->campaignPendingToSends;
}
public function addCampaignPendingToSend(CampaignPendingToSend $campaignPendingToSend): self
{
if (!$this->campaignPendingToSends->contains($campaignPendingToSend)) {
$this->campaignPendingToSends[] = $campaignPendingToSend;
$campaignPendingToSend->setUser($this);
}
return $this;
}
public function removeCampaignPendingToSend(CampaignPendingToSend $campaignPendingToSend): self
{
if ($this->campaignPendingToSends->removeElement($campaignPendingToSend)) {
// set the owning side to null (unless already changed)
if ($campaignPendingToSend->getUser() === $this) {
$campaignPendingToSend->setUser(null);
}
}
return $this;
}
public function isNewAdd(): ?bool
{
return $this->newAdd;
}
public function isShareMyEmail(): ?bool
{
return $this->shareMyEmail;
}
public function isShareMyPhone(): ?bool
{
return $this->shareMyPhone;
}
public function isIsActiveNotification(): ?bool
{
return $this->isActiveNotification;
}
public function isDeleted(): ?bool
{
return $this->deleted;
}
public function isReferencingConfirmationNotification(): ?bool
{
return $this->referencingConfirmationNotification;
}
public function isIsLogged(): ?bool
{
return $this->isLogged;
}
/**
* @return Collection<int, FileMission>
*/
public function getFileMissions(): Collection
{
return $this->fileMissions;
}
public function addFileMission(FileMission $fileMission): static
{
if (!$this->fileMissions->contains($fileMission)) {
$this->fileMissions->add($fileMission);
$fileMission->setUser($this);
}
return $this;
}
public function removeFileMission(FileMission $fileMission): static
{
if ($this->fileMissions->removeElement($fileMission)) {
// set the owning side to null (unless already changed)
if ($fileMission->getUser() === $this) {
$fileMission->setUser(null);
}
}
return $this;
}
public function getIsNewClient(): ?bool
{
return $this->isNewClient;
}
public function setIsNewClient(?bool $isNewClient): self
{
$this->isNewClient = $isNewClient;
return $this;
}
public function getAutorizationDateAt(): ?\DateTimeImmutable
{
return $this->autorizationDateAt;
}
public function setAutorizationDateAt(?\DateTimeImmutable $autorizationDateAt): self
{
$this->autorizationDateAt = $autorizationDateAt;
return $this;
}
public function getUserData(): ?UserData
{
return $this->userData;
}
public function setUserData(?UserData $userData): self
{
$this->userData = $userData;
return $this;
}
public function getAcceptPresentation(): ?bool
{
return $this->acceptPresentation;
}
public function setAcceptPresentation(?bool $acceptPresentation): self
{
$this->acceptPresentation = $acceptPresentation;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(?string $title): self
{
$this->title = $title;
return $this;
}
public function getOneTimeLoginToken(): ?string
{
return $this->oneTimeLoginToken;
}
public function setOneTimeLoginToken(?string $oneTimeLoginToken): self
{
$this->oneTimeLoginToken = $oneTimeLoginToken;
return $this;
}
public function getState(): ?string
{
return $this->state;
}
public function setState(?string $state): self
{
$this->state = $state;
return $this;
}
/**
* @return Collection|Portfolio[]
*/
public function getPortfolio(): Collection
{
return $this->portfolio;
}
public function addPortfolio(Portfolio $portfolio): self
{
if (!$this->portfolio->contains($portfolio)) {
$this->portfolio[] = $portfolio;
$portfolio->setUser($this);
}
return $this;
}
public function removePortfolio(Portfolio $portfolio): self
{
if ($this->portfolio->removeElement($portfolio)) {
// set the owning side to null (unless already changed)
if ($portfolio->getUser() === $this) {
$portfolio->setUser(null);
}
}
return $this;
}
public function getSalary(): ?bool
{
return $this->salary;
}
public function setSalary(?bool $salary): self
{
$this->salary = $salary;
return $this;
}
public function getAllCompany(): ?bool
{
return $this->allCompany;
}
public function setAllCompany(?bool $allCompany): self
{
$this->allCompany = $allCompany;
return $this;
}
public function getManager(): ?bool
{
return $this->manager;
}
public function setManager(?bool $manager): self
{
$this->manager = $manager;
return $this;
}
/**
* @return Collection|Company[]
*/
public function getOtherCompany(): Collection
{
return $this->otherCompany;
}
public function addOtherCompany(Company $otherCompany): self
{
if (!$this->otherCompany->contains($otherCompany)) {
$this->otherCompany[] = $otherCompany;
}
return $this;
}
public function removeOtherCompany(Company $otherCompany): self
{
$this->otherCompany->removeElement($otherCompany);
return $this;
}
public function getPartner(): ?bool
{
return $this->partner;
}
public function setPartner(?bool $partner): self
{
$this->partner = $partner;
return $this;
}
public function getParent(): ?self
{
return $this->parent;
}
public function setParent(?self $parent): self
{
$this->parent = $parent;
return $this;
}
/**
* @return Collection|User[]
*/
public function getChildren(): Collection
{
return $this->children;
}
public function addChild(User $child): self
{
if (!$this->children->contains($child)) {
$this->children[] = $child;
$child->setParent($this);
}
return $this;
}
public function removeChild(User $child): self
{
if ($this->children->removeElement($child)) {
// set the owning side to null (unless already changed)
if ($child->getParent() === $this) {
$child->setParent(null);
}
}
return $this;
}
public function getOriginalEmail(): ?string
{
return $this->OriginalEmail;
}
public function setOriginalEmail(?string $OriginalEmail): self
{
$this->OriginalEmail = $OriginalEmail;
return $this;
}
/**
* @return Collection|SignedContract[]
*/
public function getSignedContracts(): Collection
{
return $this->signedContracts;
}
public function addSignedContract(SignedContract $signedContract): self
{
if (!$this->signedContracts->contains($signedContract)) {
$this->signedContracts[] = $signedContract;
$signedContract->setUser($this);
}
return $this;
}
public function removeSignedContract(SignedContract $signedContract): self
{
if ($this->signedContracts->removeElement($signedContract)) {
// set the owning side to null (unless already changed)
if ($signedContract->getUser() === $this) {
$signedContract->setUser(null);
}
}
return $this;
}
/**
* @return Collection|Company[]
*/
public function getCompaniesRepresentative(): Collection
{
return $this->companiesRepresentative;
}
public function addCompanyRepresentative(Company $companiesRepresentative): self
{
if (!$this->companiesRepresentative->contains($companiesRepresentative)) {
$this->companiesRepresentative[] = $companiesRepresentative;
$companiesRepresentative->setRepresentative($this);
}
return $this;
}
public function removeCompanyRepresentative(Company $companiesRepresentative): self
{
if ($this->companiesRepresentative->removeElement($companiesRepresentative)) {
// set the owning side to null (unless already changed)
if ($companiesRepresentative->getRepresentative() === $this) {
$companiesRepresentative->setRepresentative(null);
}
}
return $this;
}
/**
* @return Collection|Product[]
*/
public function getProducts(): Collection
{
return $this->products;
}
public function addProduct(Product $product): self
{
if (!$this->products->contains($product)) {
$this->products[] = $product;
$product->setCreatedBy($this);
}
return $this;
}
public function removeProduct(Product $product): self
{
if ($this->products->removeElement($product)) {
// set the owning side to null (unless already changed)
if ($product->getCreatedBy() === $this) {
$product->setCreatedBy(null);
}
}
return $this;
}
/**
* @return Collection|WorkflowStep[]
*/
public function getWorkflowSteps(): Collection
{
return $this->workflowSteps;
}
public function addWorkflowStep(WorkflowStep $workflowStep): self
{
if (!$this->workflowSteps->contains($workflowStep)) {
$this->workflowSteps[] = $workflowStep;
$workflowStep->addUserResponsable($this);
}
return $this;
}
public function removeWorkflowStep(WorkflowStep $workflowStep): self
{
if ($this->workflowSteps->removeElement($workflowStep)) {
$workflowStep->removeUserResponsable($this);
}
return $this;
}
// for api only
public function getListAccount()
{
return $this->listAccount;
}
public function setListAccount($listAccount){
$this->listAccount = $listAccount;
return $this;
}
public function getRoleName()
{
return $this->roleName;
}
public function setRoleName($roleName){
$this->roleName = $roleName;
return $this;
}
public function getIdentifier(): ?string
{
return $this->identifier;
}
public function setIdentifier(?string $identifier): self
{
$this->identifier = $identifier;
return $this;
}
/**
* @return Collection<int, SharedResourcesCategory>
*/
public function getSharedResourcesCategories(): Collection
{
return $this->sharedResourcesCategories;
}
public function addSharedResourcesCategory(SharedResourcesCategory $sharedResourcesCategory): static
{
if (!$this->sharedResourcesCategories->contains($sharedResourcesCategory)) {
$this->sharedResourcesCategories->add($sharedResourcesCategory);
$sharedResourcesCategory->setCreatedBy($this);
}
return $this;
}
public function removeSharedResourcesCategory(SharedResourcesCategory $sharedResourcesCategory): static
{
if ($this->sharedResourcesCategories->removeElement($sharedResourcesCategory)) {
// set the owning side to null (unless already changed)
if ($sharedResourcesCategory->getCreatedBy() === $this) {
$sharedResourcesCategory->setCreatedBy(null);
}
}
return $this;
}
/**
* @return Collection<int, CompanyResource>
*/
public function getCompanyResources(): Collection
{
return $this->companyResources;
}
public function addCompanyResource(CompanyResource $companyResource): static
{
if (!$this->companyResources->contains($companyResource)) {
$this->companyResources->add($companyResource);
$companyResource->setCreatedBy($this);
}
return $this;
}
public function removeCompanyResource(CompanyResource $companyResource): static
{
if ($this->companyResources->removeElement($companyResource)) {
// set the owning side to null (unless already changed)
if ($companyResource->getCreatedBy() === $this) {
$companyResource->setCreatedBy(null);
}
}
return $this;
}
// public function getFilePermissions(): ?FilePermissions
// {
// return $this->filePermissions;
// }
// public function setFilePermissions(?FilePermissions $filePermissions): static
// {
// $this->filePermissions = $filePermissions;
// return $this;
// }
/**
* @return Collection<int, ResourceDeliverableHistory>
*/
public function getResourceDeliverableHistories(): Collection
{
return $this->resourceDeliverableHistories;
}
public function addResourceDeliverableHistory(ResourceDeliverableHistory $resourceDeliverableHistory): static
{
if (!$this->resourceDeliverableHistories->contains($resourceDeliverableHistory)) {
$this->resourceDeliverableHistories->add($resourceDeliverableHistory);
$resourceDeliverableHistory->setCreatedBy($this);
}
return $this;
}
public function removeResourceDeliverableHistory(ResourceDeliverableHistory $resourceDeliverableHistory): static
{
if ($this->resourceDeliverableHistories->removeElement($resourceDeliverableHistory)) {
// set the owning side to null (unless already changed)
if ($resourceDeliverableHistory->getCreatedBy() === $this) {
$resourceDeliverableHistory->setCreatedBy(null);
}
}
return $this;
}
/**
* @return Collection<int, FilesResourceDeliverableHistory>
*/
public function getFilesResourceDeliverableHistories(): Collection
{
return $this->filesResourceDeliverableHistories;
}
public function addFilesResourceDeliverableHistory(FilesResourceDeliverableHistory $filesResourceDeliverableHistory): static
{
if (!$this->filesResourceDeliverableHistories->contains($filesResourceDeliverableHistory)) {
$this->filesResourceDeliverableHistories->add($filesResourceDeliverableHistory);
$filesResourceDeliverableHistory->setCreatedBy($this);
}
return $this;
}
public function removeFilesResourceDeliverableHistory(FilesResourceDeliverableHistory $filesResourceDeliverableHistory): static
{
if ($this->filesResourceDeliverableHistories->removeElement($filesResourceDeliverableHistory)) {
// set the owning side to null (unless already changed)
if ($filesResourceDeliverableHistory->getCreatedBy() === $this) {
$filesResourceDeliverableHistory->setCreatedBy(null);
}
}
return $this;
}
/**
* @return Collection<int, FilePermissions>
*/
public function getFilePermissions(): Collection
{
return $this->filePermissions;
}
public function addFilePermission(FilePermissions $filePermission): static
{
if (!$this->filePermissions->contains($filePermission)) {
$this->filePermissions->add($filePermission);
$filePermission->addUser($this);
}
return $this;
}
public function removeFilePermission(FilePermissions $filePermission): static
{
if ($this->filePermissions->removeElement($filePermission)) {
$filePermission->removeUser($this);
}
return $this;
}
/**
* @return Collection<int, FolderPermissions>
*/
public function getFolderPermissions(): Collection
{
return $this->folderPermissions;
}
public function addFolderPermission(FolderPermissions $folderPermission): static
{
if (!$this->folderPermissions->contains($folderPermission)) {
$this->folderPermissions->add($folderPermission);
$folderPermission->addUser($this);
}
return $this;
}
public function removeFolderPermission(FolderPermissions $folderPermission): static
{
if ($this->folderPermissions->removeElement($folderPermission)) {
$folderPermission->removeUser($this);
}
return $this;
}
/**
* @return Collection<int, FolderPermissions>
*/
public function getFolderPermissionsCreatedBy(): Collection
{
return $this->folderPermissionsCreatedBy;
}
public function addFolderPermissionsCreatedBy(FolderPermissions $folderPermissionsCreatedBy): static
{
if (!$this->folderPermissionsCreatedBy->contains($folderPermissionsCreatedBy)) {
$this->folderPermissionsCreatedBy->add($folderPermissionsCreatedBy);
$folderPermissionsCreatedBy->setCreatedBy($this);
}
return $this;
}
public function removeFolderPermissionsCreatedBy(FolderPermissions $folderPermissionsCreatedBy): static
{
if ($this->folderPermissionsCreatedBy->removeElement($folderPermissionsCreatedBy)) {
// set the owning side to null (unless already changed)
if ($folderPermissionsCreatedBy->getCreatedBy() === $this) {
$folderPermissionsCreatedBy->setCreatedBy(null);
}
}
return $this;
}
/**
* @return Collection<int, FilePermissions>
*/
public function getFilePermissionsCreatedBy(): Collection
{
return $this->filePermissionsCreatedBy;
}
public function addFilePermissionsCreatedBy(FilePermissions $filePermissionsCreatedBy): static
{
if (!$this->filePermissionsCreatedBy->contains($filePermissionsCreatedBy)) {
$this->filePermissionsCreatedBy->add($filePermissionsCreatedBy);
$filePermissionsCreatedBy->setCreatedBy($this);
}
return $this;
}
public function removeFilePermissionsCreatedBy(FilePermissions $filePermissionsCreatedBy): static
{
if ($this->filePermissionsCreatedBy->removeElement($filePermissionsCreatedBy)) {
// set the owning side to null (unless already changed)
if ($filePermissionsCreatedBy->getCreatedBy() === $this) {
$filePermissionsCreatedBy->setCreatedBy(null);
}
}
return $this;
}
}