<?php
namespace App\Entity\Gos;
use App\Entity\Gos\RenewalOffer\UserRenewalOffer;
use App\Entity\Gos\Uniqskills\LessonReminder;
use App\Entity\Gos\Uniqskills\MergeLog;
use App\Entity\Gos\Uniqskills\OrderError;
use App\Entity\Gos\Uniqskills\Test;
use App\Entity\Gos\Uniqskills\UserAnswer;
use App\Entity\Gos\Uniqskills\UserCertificate;
use App\Entity\Gos\Uniqskills\UserLesson;
use App\Entity\Gos\Uniqskills\UserTest;
use App\Entity\Gos\Uniqskills\UserVideoNotes;
use App\Entity\Gos\VirtualCurrency\VirtualCurrencyOrder;
use App\Entity\Gos\VirtualCurrency\VirtualCurrencyTransaction;
use App\Entity\Gos\VirtualCurrency\VirtualCurrencyWallet;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\EntityNotFoundException;
use ForumMedia\OTPLoginBundle\Traits\OTPPropertiesTrait;
use FOS\UserBundle\Model\GroupInterface;
use FOS\UserBundle\Model\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
use libphonenumber\NumberParseException;
use libphonenumber\PhoneNumberFormat;
use libphonenumber\PhoneNumberUtil;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Symfony\Component\Validator\Constraints as Assert;
use JMS\Serializer\Annotation as JMS;
use Symfony\Component\HttpFoundation\File\File;
/**
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
* @ORM\Table(name="fos_user")
* @ORM\HasLifecycleCallbacks
* @Vich\Uploadable
* @UniqueEntity(fields="emailCanonical", errorPath="email", message="fos_user.email.already_used")
* @UniqueEntity(fields="nick", message="fos_user.nick.already_used")
*/
class User extends BaseUser
{
use OTPPropertiesTrait;
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
* @JMS\Groups({"ApiMessage", "ApiMessageThread"})
*/
protected $id;
public function __construct()
{
parent::__construct();
$this->orders = new ArrayCollection();
$this->salesManagoEvent = new ArrayCollection();
$this->orderProductVariantUser = new ArrayCollection();
$this->passwordFromImport = new ArrayCollection();
$this->userTerms = new ArrayCollection();
$this->assignedCoupons = new ArrayCollection();
$this->groups = new ArrayCollection();
$this->touchPoint = new ArrayCollection();
$this->touchPointAll = new ArrayCollection();
$this->alerts = new ArrayCollection();
$this->notifications = new ArrayCollection();
$this->messages = new ArrayCollection();
$this->emailChangeHistories = new ArrayCollection();
$this->userLesson = new ArrayCollection();
$this->mergeLog = new ArrayCollection();
$this->lessonReminder = new ArrayCollection();
$this->userAnswer = new ArrayCollection();
$this->userTest = new ArrayCollection();
$this->test = new ArrayCollection();
$this->salesManagoClient = new ArrayCollection();
$this->accessToPortalSettings = new ArrayCollection();
$this->ordersError = new ArrayCollection();
$this->braintreeResponse = new ArrayCollection();
$this->userCertificates = new ArrayCollection();
$this->additionalInformation = new ArrayCollection();
$this->userFiles = new ArrayCollection();
$this->userNotification = new ArrayCollection();
$this->foLogs = new ArrayCollection();
$this->userCards = new ArrayCollection();
$this->userVideoNotes = new ArrayCollection();
$this->eventNotificationSchedulers = new ArrayCollection();
$this->presenceOnEvents = new ArrayCollection();
$this->userFirstLoginInfos = new ArrayCollection();
$this->userDevices = new ArrayCollection();
$this->smsCodes = new ArrayCollection();
$this->emails = new ArrayCollection();
$this->virtualCurrencyWallets = new ArrayCollection();
$this->virtualCurrencyTransactions = new ArrayCollection();
$this->virtualCurrencyOrders = new ArrayCollection();
$this->loginHistories = new ArrayCollection();
$this->userCertificatePaths = new ArrayCollection();
$this->productReleaseNotifies = new ArrayCollection();
$this->userRenewalOffers = new ArrayCollection();
$this->usingPortals = new ArrayCollection();
$this->assignedFlags = new ArrayCollection();
$this->orderProductVariantOmittedUpsells = new ArrayCollection();
}
/**
* Needed for import user from Uniqskills
*
* @ORM\Column(type="integer", nullable=true)
*/
protected $tempUniqskillsId;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $salesmanagoContactid;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $sessionId;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $firstName;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $lastName;
/**
* @ORM\Column(type="string", length=255, nullable=true, unique=true)
*/
private $nick;
/**
* @ORM\Column(type="string", length=30, nullable=true)
* @Assert\Length(max = 30)
*/
private $phoneNumber;
/**
* @ORM\Column(type="string", length=5, nullable=true)
*/
private $phoneNumberPrefix;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $birthday;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $lastCosCheck;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $emailChange;
/**
* @ORM\Column(type="string", length=255)
*/
private $token;
/**
* @ORM\Column(name="facebook_id", type="string", length=255, nullable=true)
*/
protected $facebook_id;
/**
* @ORM\Column(name="facebook_access_token", type="string", length=255, nullable=true)
*/
protected $facebook_access_token;
/**
* @ORM\Column(name="google_id", type="string", length=255, nullable=true)
*/
protected $google_id;
/**
* @ORM\Column(name="google_access_token", type="string", length=255, nullable=true)
*/
protected $google_access_token;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default":0})
*/
private $allowedAdvertising;
/**
* NOTE: This is not a mapped field of entity metadata, just a simple property.
*
* @Assert\File(
* maxSize="200k",
* mimeTypes={"image/png", "image/jpeg", "image/pjpeg"}
* )
*
* @Vich\UploadableField(mapping="user_image", fileNameProperty="imageName")
*
* @var File
*/
private $imageFile;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*
* @var string
*/
private $imageName;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\Orders", mappedBy="user")
*/
private $orders;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\SalesManagoEvent", mappedBy="user")
*/
private $salesManagoEvent;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Gos\Address", inversedBy="user", cascade={"persist"})
* @ORM\JoinColumn()
*/
private $address;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Gos\AddressTmp", inversedBy="user")
* @ORM\JoinColumn()
*/
private $addressTmp;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Gos\Cart", mappedBy="user", cascade={"persist"})
*/
private $cart;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\OrderProductVariantUser", mappedBy="user")
*/
private $orderProductVariantUser;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\PasswordFromImport", mappedBy="user")
*/
private $passwordFromImport;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\UserTerms", mappedBy="user")
*/
private $userTerms;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\Coupon", mappedBy="user")
*/
private $assignedCoupons;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\ArchivedCoupon", mappedBy="user")
*/
private $archivedAssignedCoupons;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\TouchPoint", mappedBy="user")
*/
private $touchPoint;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\TouchPointAll", mappedBy="user")
*/
private $touchPointAll;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\Message", mappedBy="author")
*/
private $messages;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Gos\Timezone", inversedBy="user")
*/
private $timezone;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Gos\Country", inversedBy="user")
*/
private $country;
/**
* @ORM\Column(type="string", length=128, nullable=true)
*/
private $actionNumber;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $fromSource;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $reginfo;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Gos\Group", inversedBy="users")
* @ORM\JoinTable(name="users_user_group",
* joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="group_id", referencedColumnName="id")}
* )
*/
protected $groups;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\Alert", mappedBy="user")
*/
private $alerts;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\Notification", mappedBy="user")
*/
private $notifications;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\EmailChangeHistory", mappedBy="user")
*/
private $emailChangeHistories;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\Uniqskills\UserLesson", mappedBy="user")
*/
private $userLesson;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\Uniqskills\MergeLog", mappedBy="mergedByUser")
*/
private $mergeLog;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\Uniqskills\LessonReminder", mappedBy="user")
*/
private $lessonReminder;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\Uniqskills\UserAnswer", mappedBy="user")
*/
private $userAnswer;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\Uniqskills\UserTest", mappedBy="user")
*/
private $userTest;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\Uniqskills\Test", mappedBy="user")
*/
private $test;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\SalesManagoClient", mappedBy="user")
*/
private $salesManagoClient;
/**
* @ORM\ManyToMany(targetEntity="PortalSettings", inversedBy="accessUser")
* @ORM\JoinTable()
*/
private $accessToPortalSettings;
/**
* @ORM\ManyToOne(targetEntity="PortalSettings", inversedBy="registeredUser")
* @ORM\JoinColumn()
*/
private $registeredFrom;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\Uniqskills\OrderError", mappedBy="user")
*/
private $ordersError;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $activationDate;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Gos\Orders", inversedBy="userFirstOrder", cascade={"persist"})
*/
private $orderDuringRegistration;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $campaign;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $campaignChannel;
/**
* @ORM\OneToMany(targetEntity="BraintreeResponse", mappedBy="user")
*/
private $braintreeResponse;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\Uniqskills\UserCertificate", mappedBy="user")
*/
private $userCertificates;
/**
* @ORM\ManyToOne(targetEntity="UserPosition", inversedBy="user")
*/
private $position;
/**
* @ORM\OneToMany(targetEntity="UserAdditionalInfo", mappedBy="user", orphanRemoval=true, cascade={"persist"})
*/
private $additionalInformation;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $marketing;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\UserFiles", mappedBy="user")
*/
private $userFiles;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $sendReminderActivation;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default":0})
*/
private $employeeAccount = 0;
/** @var @ORM\Column(type="boolean", nullable=true, options={"default":0}) */
private $isRobinson;
/**
* @ORM\Column(type="string", length=6, nullable=true)
*/
private $resettingCode;
/**
* @ORM\Column(type="string", length=6, nullable=true)
*/
private $activationCode;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $folders;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $savedArticles;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $foldersArticlesUpdatedAt;
/**
* @ORM\OneToMany(targetEntity="UserNotification", mappedBy="user")
*/
private $userNotification;
/**
* @ORM\OneToMany(targetEntity=FoLog::class, mappedBy="user")
*/
private $foLogs;
/**
* @ORM\OneToMany(targetEntity=UserCard::class, mappedBy="user", orphanRemoval=true)
*/
private $userCards;
/**
* @ORM\OneToMany(targetEntity=UserVideoNotes::class, mappedBy="user")
*/
private $userVideoNotes;
/**
* @ORM\OneToMany(targetEntity=EventNotificationScheduler::class, mappedBy="user")
*/
private $eventNotificationSchedulers;
/**
* @ORM\ManyToMany(targetEntity=Events::class, mappedBy="presentUsers")
*/
private $presenceOnEvents;
/**
* @ORM\Column(type="string", length=4, nullable=true)
*/
private $oneTimePassword;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $otpToken;
/**
* @ORM\OneToMany(targetEntity=UserFirstLoginInfo::class, mappedBy="user")
*/
private $userFirstLoginInfos;
/**
* @ORM\OneToMany(targetEntity=UserDevices::class, mappedBy="user")
*/
private $userDevices;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $deviceAuthCode;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $deviceAuthToken;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\LeadFormCompleted", mappedBy="user")
*/
private $leadFormCompleted;
/**
* @ORM\OneToMany(targetEntity=SmsCode::class, mappedBy="user", orphanRemoval=true)
*/
private $smsCodes;
/**
* @ORM\OneToMany(targetEntity=Email::class, mappedBy="user")
*/
private $emails;
/**
* @ORM\OneToMany(targetEntity=VirtualCurrencyWallet::class, mappedBy="user")
*/
private $virtualCurrencyWallets;
/**
* @ORM\OneToMany(targetEntity=VirtualCurrencyTransaction::class, mappedBy="user")
*/
private $virtualCurrencyTransactions;
/**
* @ORM\OneToMany(targetEntity=VirtualCurrencyOrder::class, mappedBy="user")
*/
private $virtualCurrencyOrders;
/**
* @ORM\OneToMany(targetEntity=LoginHistory::class, mappedBy="user", orphanRemoval=true)
*/
private $loginHistories;
/**
* @ORM\OneToMany(targetEntity=UserCertificatePath::class, mappedBy="user")
*/
private $userCertificatePaths;
/**
* @ORM\OneToMany(targetEntity=ProductReleaseNotify::class, mappedBy="user")
*/
private $productReleaseNotifies;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $lastFailureDiaboloResponseAt;
/**
* @ORM\OneToMany(targetEntity=UserRenewalOffer::class, mappedBy="user", orphanRemoval=true)
*/
private $userRenewalOffers;
/**
* @ORM\ManyToMany(targetEntity=PortalSettings::class, inversedBy="users")
* @ORM\JoinTable(name="user_uses_portal")
*/
private $usingPortals;
/**
* @ORM\OneToMany(targetEntity=AssignedUserFlag::class, mappedBy="user", orphanRemoval=true)
*/
private $assignedFlags;
/**
* @ORM\OneToMany(targetEntity=OrderProductVariantOmittedUpsell::class, mappedBy="user")
*/
private $orderProductVariantOmittedUpsells;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $npwz;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isDarkModeActive = 0;
/**
* TODO: DEV-784 delete field after complete withdrawal of GetResponse
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $getResponseContactId;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $salesmanago2ContactId;
/** @ORM\PrePersist() */
public function prePersist()
{
$this->token = uniqid(bin2hex(random_bytes(10)));
$this->createdAt = new \DateTime();
}
/** @ORM\PreUpdate() */
public function preUpdate()
{
$this->updatedAt = new \DateTime();
}
public function getRoles(): array
{
$roles = parent::getRoles();
foreach ($this->groups as $group)
{
$roles = array_merge($roles, $group->getRoles());
}
return $roles;
}
public function getUserFilesWithoutVideos()
{
return array_filter($this->userFiles->toArray(), function($fileUser){ return !($fileUser->getFile()->isVideo());});
}
public function getUserVideos()
{
return array_filter($this->userFiles->toArray(), function($fileUser){ return ($fileUser->getFile()->isVideo());});
}
public function checkUserHasFile(\App\Entity\Gos\File $file): bool
{
$existFile = array_filter($this->userFiles->toArray(), function($fileUser) use($file) { return ($fileUser->getFile() === $file);});
return !empty($existFile);
}
public function checkUserHasCertificate(\App\Entity\Gos\Uniqskills\Certificate $certificate): bool
{
$existCertificate = array_filter($this->userCertificates->toArray(), function($userCertificate) use($certificate) { return ($userCertificate->getCertificate() === $certificate);});
return !empty($existCertificate);
}
public function getUserFastCertificates(): array
{
return array_filter($this->userCertificates->toArray(), function($userCertificate){
return ($userCertificate->getCertificate()->isFastCertificate() && $userCertificate->getIsFromCertificatePath() !== true);
});
}
public function getUserPaidCertificates(): array
{
return array_filter($this->userCertificates->toArray(), function($userCertificate){
return ($userCertificate->getCertificate()->isPaidCertificate() && $userCertificate->getIsFromCertificatePath() !== true);
});
}
public function base64EncodeUserId()
{
return base64_encode('user-'.$this->id);
}
public function setEmail($email)
{
$email = is_null($email) ? '' : $email;
parent::setEmail($email);
$this->setUsername($email);
return $this;
}
public function getObjectVars()
{
return get_object_vars($this);
}
/**
* If manually uploading a file (i.e. not using Symfony Form) ensure an instance
* of 'UploadedFile' is injected into this setter to trigger the update. If this
* bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
* must be able to accept an instance of 'File' as the bundle will inject one here
* during Doctrine hydration.
*
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $image
*
* @return User
*/
public function setImageFile(File $image = null)
{
$this->imageFile = $image;
if ($image) {
// 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();
}
return $this;
}
/**
* @return File|null
*/
public function getImageFile()
{
return $this->imageFile;
}
/**
* @param string $imageName
*
* @return User
*/
public function setImageName($imageName)
{
$this->imageName = $imageName;
return $this;
}
/**
* @return string|null
*/
public function getImageName()
{
return $this->imageName;
}
/**
* Set sessionId
*
* @param string $sessionId
*
* @return User
*/
public function setSessionId($sessionId)
{
$this->sessionId = $sessionId;
return $this;
}
/**
* Get sessionId
*
* @return string
*/
public function getSessionId()
{
return $this->sessionId;
}
/**
* Set firstName
*
* @param string $firstName
*
* @return User
*/
public function setFirstName($firstName)
{
$this->firstName = $firstName;
return $this;
}
/**
* Get firstName
*
* @return string
*/
public function getFirstName()
{
return $this->firstName;
}
/**
* Set lastName
*
* @param string $lastName
*
* @return User
*/
public function setLastName($lastName)
{
$this->lastName = $lastName;
return $this;
}
/**
* Get lastName
*
* @return string
*/
public function getLastName()
{
return $this->lastName;
}
/**
* Set nick
*
* @param string $nick
*
* @return User
*/
public function setNick($nick)
{
$this->nick = $nick;
return $this;
}
/**
* Get nick
*
* @return string
*/
public function getNick()
{
return $this->nick;
}
/**
* @return string
*/
public function getNickForCMS()
{
return isset($this->nick)
? $this->nick
: (
isset($this->firstName)
? $this->firstName
: "User"
);
}
/**
* Set phoneNumber
*
* @param string $phoneNumber
*
* @return User
*/
public function setPhoneNumber($phoneNumber)
{
$this->phoneNumber = $phoneNumber;
return $this;
}
/**
* Get phoneNumber
*
* @return string
*/
public function getPhoneNumber()
{
return $this->phoneNumber;
}
public function getPhoneNumberWithPLPrefix(): ?string
{
if ($this->getPhoneNumber() === null)
{
return null;
}
$phoneUtil = PhoneNumberUtil::getInstance();
try {
$parsedNumber = $phoneUtil->parse($this->getPhoneNumber(), 'PL');
if ($parsedNumber && $phoneUtil->isValidNumber($parsedNumber)) {
return $phoneUtil->format($parsedNumber, PhoneNumberFormat::E164);
}
} catch (NumberParseException $e) {}
return null;
}
/**
* Set phoneNumberPrefix
*
* @param string $phoneNumberPrefix
* @return User
*/
public function setPhoneNumberPrefix($phoneNumberPrefix)
{
$this->phoneNumberPrefix = $phoneNumberPrefix;
return $this;
}
/**
* @return mixed
*/
public function getBirthday()
{
return $this->birthday;
}
/**
* @param mixed $birthday
*/
public function setBirthday($birthday)
{
$this->birthday = $birthday;
return $this;
}
/**
* Get phoneNumberPrefix
*
* @return string
*/
public function getPhoneNumberPrefix()
{
return $this->phoneNumberPrefix;
}
/**
* Set lastCosCheck
*
* @param \DateTime $lastCosCheck
*
* @return User
*/
public function setLastCosCheck($lastCosCheck)
{
$this->lastCosCheck = $lastCosCheck;
return $this;
}
/**
* Get lastCosCheck
*
* @return \DateTime
*/
public function getLastCosCheck()
{
return $this->lastCosCheck;
}
/**
* Set token
*
* @param string $token
*
* @return User
*/
public function setToken($token)
{
$this->token = $token;
return $this;
}
/**
* Get token
*
* @return string
*/
public function getToken()
{
return $this->token;
}
/**
* Set createdAt
*
* @param \DateTime $createdAt
*
* @return User
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return \DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set updatedAt
*
* @param \DateTime $updatedAt
*
* @return User
*/
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Get updatedAt
*
* @return \DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Add order
*
* @param \App\Entity\Gos\Orders $order
*
* @return User
*/
public function addOrder(\App\Entity\Gos\Orders $order)
{
$this->orders[] = $order;
return $this;
}
/**
* Remove order
*
* @param \App\Entity\Gos\Orders $order
*/
public function removeOrder(\App\Entity\Gos\Orders $order)
{
$this->orders->removeElement($order);
}
/**
* Get orders
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getOrders()
{
return $this->orders;
}
/**
* Set address
*
* @param \App\Entity\Gos\Address $address
*
* @return User
*/
public function setAddress(\App\Entity\Gos\Address $address = null)
{
$this->address = $address;
return $this;
}
/**
* Get address
*
* @return \App\Entity\Gos\Address
*/
public function getAddress()
{
return $this->address;
}
/**
* Set cart
*
* @param \App\Entity\Gos\Cart $cart
*
* @return User
*/
public function setCart(\App\Entity\Gos\Cart $cart = null)
{
$this->cart = $cart;
return $this;
}
/**
* Get cart
*
* @return \App\Entity\Gos\Cart
*/
public function getCart()
{
return $this->cart;
}
/**
* Set emailChange
*
* @param boolean $emailChange
*
* @return User
*/
public function setEmailChange($emailChange)
{
$this->emailChange = $emailChange;
return $this;
}
/**
* Get emailChange
*
* @return boolean
*/
public function getEmailChange()
{
return $this->emailChange;
}
/**
* Set facebookId
*
* @param string $facebookId
*
* @return User
*/
public function setFacebookId($facebookId)
{
$this->facebook_id = $facebookId;
return $this;
}
/**
* Get facebookId
*
* @return string
*/
public function getFacebookId()
{
return $this->facebook_id;
}
/**
* Set googleId
*
* @param string $googleId
*
* @return User
*/
public function setGoogleId($googleId)
{
$this->google_id = $googleId;
return $this;
}
/**
* Get googleId
*
* @return string
*/
public function getGoogleId()
{
return $this->google_id;
}
/**
* Set facebookAccessToken
*
* @param string $facebookAccessToken
*
* @return User
*/
public function setFacebookAccessToken($facebookAccessToken)
{
$this->facebook_access_token = $facebookAccessToken;
return $this;
}
/**
* Get facebookAccessToken
*
* @return string
*/
public function getFacebookAccessToken()
{
return $this->facebook_access_token;
}
/**
* Set googleAccessToken
*
* @param string $googleAccessToken
*
* @return User
*/
public function setGoogleAccessToken($googleAccessToken)
{
$this->google_access_token = $googleAccessToken;
return $this;
}
/**
* Get googleAccessToken
*
* @return string
*/
public function getGoogleAccessToken()
{
return $this->google_access_token;
}
/**
* Add orderProductVariantUser
*
* @param \App\Entity\Gos\OrderProductVariantUser $orderProductVariantUser
*
* @return User
*/
public function addOrderProductVariantUser(\App\Entity\Gos\OrderProductVariantUser $orderProductVariantUser)
{
$this->orderProductVariantUser[] = $orderProductVariantUser;
return $this;
}
/**
* Remove orderProductVariantUser
*
* @param \App\Entity\Gos\OrderProductVariantUser $orderProductVariantUser
*/
public function removeOrderProductVariantUser(\App\Entity\Gos\OrderProductVariantUser $orderProductVariantUser)
{
$this->orderProductVariantUser->removeElement($orderProductVariantUser);
}
/**
* Get orderProductVariantUser
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getOrderProductVariantUser()
{
return $this->orderProductVariantUser;
}
/**
* Add passwordFromImport
*
* @param \App\Entity\Gos\PasswordFromImport $passwordFromImport
*
* @return User
*/
public function addPasswordFromImport(\App\Entity\Gos\PasswordFromImport $passwordFromImport)
{
$this->passwordFromImport[] = $passwordFromImport;
return $this;
}
/**
* Remove passwordFromImport
*
* @param \App\Entity\Gos\PasswordFromImport $passwordFromImport
*/
public function removePasswordFromImport(\App\Entity\Gos\PasswordFromImport $passwordFromImport)
{
$this->passwordFromImport->removeElement($passwordFromImport);
}
/**
* Get passwordFromImport
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getPasswordFromImport()
{
return $this->passwordFromImport;
}
/**
* Set timezone
*
* @param \App\Entity\Gos\Timezone $timezone
*
* @return User
*/
public function setTimezone(\App\Entity\Gos\Timezone $timezone)
{
$this->timezone = $timezone;
return $this;
}
/**
* Get timezone
*
* @return \App\Entity\Gos\Timezone
*/
public function getTimezone()
{
return $this->timezone;
}
/**
* Set country
*
* @param \App\Entity\Gos\Country $country
*
* @return User
*/
public function setCountry(\App\Entity\Gos\Country $country)
{
$this->country = $country;
return $this;
}
/**
* Get country
*
* @return \App\Entity\Gos\Country
*/
public function getCountry()
{
return $this->country;
}
/**
* Set actionNumber
*
* @param string $actionNumber
*
* @return User
*/
public function setActionNumber($actionNumber)
{
$this->actionNumber = $actionNumber;
return $this;
}
/**
* Get actionNumber
*
* @return string
*/
public function getActionNumber()
{
return $this->actionNumber;
}
/**
* Add userTerm
*
* @param \App\Entity\Gos\UserTerms $userTerm
*
* @return User
*/
public function addUserTerm(\App\Entity\Gos\UserTerms $userTerm)
{
$this->userTerms[] = $userTerm;
return $this;
}
/**
* Remove userTerm
*
* @param \App\Entity\Gos\UserTerms $userTerm
*/
public function removeUserTerm(\App\Entity\Gos\UserTerms $userTerm)
{
$this->userTerms->removeElement($userTerm);
}
/**
* Get userTerms
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getUserTerms()
{
return $this->userTerms;
}
/**
* Set allowedAdvertising
*
* @param boolean $allowedAdvertising
*
* @return User
*/
public function setAllowedAdvertising($allowedAdvertising)
{
$this->allowedAdvertising = $allowedAdvertising;
return $this;
}
/**
* Get allowedAdvertising
*
* @return boolean
*/
public function getAllowedAdvertising()
{
return $this->allowedAdvertising;
}
/**
* Add salesManagoEvent
*
* @param \App\Entity\Gos\SalesManagoEvent $salesManagoEvent
*
* @return User
*/
public function addSalesManagoEvent(\App\Entity\Gos\SalesManagoEvent $salesManagoEvent)
{
$this->salesManagoEvent[] = $salesManagoEvent;
return $this;
}
/**
* Remove salesManagoEvent
*
* @param \App\Entity\Gos\SalesManagoEvent $salesManagoEvent
*/
public function removeSalesManagoEvent(\App\Entity\Gos\SalesManagoEvent $salesManagoEvent)
{
$this->salesManagoEvent->removeElement($salesManagoEvent);
}
/**
* Get salesManagoEvent
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getSalesManagoEvent()
{
return $this->salesManagoEvent;
}
public function getId(): ?int
{
return $this->id;
}
/**
* @return Collection|Coupon[]
*/
public function getAssignedCoupons(): Collection
{
return $this->assignedCoupons;
}
public function addAssignedCoupon(Coupon $assignedCoupon): self
{
if (!$this->assignedCoupons->contains($assignedCoupon)) {
$this->assignedCoupons[] = $assignedCoupon;
$assignedCoupon->setUser($this);
}
return $this;
}
public function removeAssignedCoupon(Coupon $assignedCoupon): self
{
if ($this->assignedCoupons->contains($assignedCoupon)) {
$this->assignedCoupons->removeElement($assignedCoupon);
// set the owning side to null (unless already changed)
if ($assignedCoupon->getUser() === $this) {
$assignedCoupon->setUser(null);
}
}
return $this;
}
/**
* @return Collection|TouchPoint[]
*/
public function getTouchPoint(): Collection
{
return $this->touchPoint;
}
public function addTouchPoint(TouchPoint $touchPoint): self
{
if (!$this->touchPoint->contains($touchPoint)) {
$this->touchPoint[] = $touchPoint;
$touchPoint->setUser($this);
}
return $this;
}
public function removeTouchPoint(TouchPoint $touchPoint): self
{
if ($this->touchPoint->contains($touchPoint)) {
$this->touchPoint->removeElement($touchPoint);
// set the owning side to null (unless already changed)
if ($touchPoint->getUser() === $this) {
$touchPoint->setUser(null);
}
}
return $this;
}
/**
* @return Collection|Alert[]
*/
public function getAlerts(): Collection
{
return $this->alerts;
}
public function addAlert(Alert $alert): self
{
if (!$this->alerts->contains($alert)) {
$this->alerts[] = $alert;
$alert->setUser($this);
}
return $this;
}
public function removeAlert(Alert $alert): self
{
if ($this->alerts->contains($alert)) {
$this->alerts->removeElement($alert);
// set the owning side to null (unless already changed)
if ($alert->getUser() === $this) {
$alert->setUser(null);
}
}
return $this;
}
/**
* @return Collection|Notification[]
*/
public function getNotifications(): Collection
{
return $this->notifications;
}
/**
* @return Collection|Alert[]
*/
public function getUnreadNotifications(): Collection
{
return $this->notifications->filter(
function ($notification) {
return $notification->getIsUnread();
}
);
}
public function addNotification(Notification $notification): self
{
if (!$this->notifications->contains($notification)) {
$this->notifications[] = $notification;
$notification->setUser($this);
}
return $this;
}
public function removeNotification(Notification $notification): self
{
if ($this->notifications->contains($notification)) {
$this->notifications->removeElement($notification);
// set the owning side to null (unless already changed)
if ($notification->getUser() === $this) {
$notification->setUser(null);
}
}
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->setAuthor($this);
}
return $this;
}
public function removeMessage(Message $message): self
{
if ($this->messages->contains($message)) {
$this->messages->removeElement($message);
// set the owning side to null (unless already changed)
if ($message->getAuthor() === $this) {
$message->setAuthor(null);
}
}
return $this;
}
/**
* @return Collection|EmailChangeHistory[]
*/
public function getEmailChangeHistories(): Collection
{
return $this->emailChangeHistories;
}
public function addEmailChangeHistory(EmailChangeHistory $emailChangeHistory): self
{
if (!$this->emailChangeHistories->contains($emailChangeHistory)) {
$this->emailChangeHistories[] = $emailChangeHistory;
$emailChangeHistory->setUser($this);
}
return $this;
}
public function removeEmailChangeHistory(EmailChangeHistory $emailChangeHistory): self
{
if ($this->emailChangeHistories->contains($emailChangeHistory)) {
$this->emailChangeHistories->removeElement($emailChangeHistory);
// set the owning side to null (unless already changed)
if ($emailChangeHistory->getUser() === $this) {
$emailChangeHistory->setUser(null);
}
}
return $this;
}
public function getSalesmanagoContactid(): ?string
{
return $this->salesmanagoContactid;
}
public function setSalesmanagoContactid(?string $salesmanagoContactid): self
{
$this->salesmanagoContactid = $salesmanagoContactid;
return $this;
}
public function getAddressTmp(): ?AddressTmp
{
return $this->addressTmp;
}
public function setAddressTmp(?AddressTmp $addressTmp): self
{
$this->addressTmp = $addressTmp;
return $this;
}
/**
* @return Collection|Group[]
*/
public function getGroups(): Collection
{
return $this->groups;
}
public function addGroup($group): self
{
if (!$this->groups->contains($group)) {
$this->groups[] = $group;
}
return $this;
}
public function removeGroup($group): self
{
if ($this->groups->contains($group)) {
$this->groups->removeElement($group);
}
return $this;
}
public function getFromSource(): ?string
{
return $this->fromSource;
}
public function setFromSource(?string $fromSource): self
{
$this->fromSource = $fromSource;
return $this;
}
/**
* @return Collection|UserLesson[]
*/
public function getUserLesson(): Collection
{
return $this->userLesson;
}
public function addUserLesson(UserLesson $userLesson): self
{
if (!$this->userLesson->contains($userLesson)) {
$this->userLesson[] = $userLesson;
$userLesson->setUser($this);
}
return $this;
}
public function removeUserLesson(UserLesson $userLesson): self
{
if ($this->userLesson->contains($userLesson)) {
$this->userLesson->removeElement($userLesson);
// set the owning side to null (unless already changed)
if ($userLesson->getUser() === $this) {
$userLesson->setUser(null);
}
}
return $this;
}
/**
* @return Collection|MergeLog[]
*/
public function getMergeLog(): Collection
{
return $this->mergeLog;
}
public function addMergeLog(MergeLog $mergeLog): self
{
if (!$this->mergeLog->contains($mergeLog)) {
$this->mergeLog[] = $mergeLog;
$mergeLog->setMergedByUser($this);
}
return $this;
}
public function removeMergeLog(MergeLog $mergeLog): self
{
if ($this->mergeLog->contains($mergeLog)) {
$this->mergeLog->removeElement($mergeLog);
// set the owning side to null (unless already changed)
if ($mergeLog->getMergedByUser() === $this) {
$mergeLog->setMergedByUser(null);
}
}
return $this;
}
/**
* @return Collection|LessonReminder[]
*/
public function getLessonReminder(): Collection
{
return $this->lessonReminder;
}
public function addLessonReminder(LessonReminder $lessonReminder): self
{
if (!$this->lessonReminder->contains($lessonReminder)) {
$this->lessonReminder[] = $lessonReminder;
$lessonReminder->setUser($this);
}
return $this;
}
public function removeLessonReminder(LessonReminder $lessonReminder): self
{
if ($this->lessonReminder->contains($lessonReminder)) {
$this->lessonReminder->removeElement($lessonReminder);
// set the owning side to null (unless already changed)
if ($lessonReminder->getUser() === $this) {
$lessonReminder->setUser(null);
}
}
return $this;
}
/**
* @return Collection|UserAnswer[]
*/
public function getUserAnswer(): Collection
{
return $this->userAnswer;
}
public function addUserAnswer(UserAnswer $userAnswer): self
{
if (!$this->userAnswer->contains($userAnswer)) {
$this->userAnswer[] = $userAnswer;
$userAnswer->setUser($this);
}
return $this;
}
public function removeUserAnswer(UserAnswer $userAnswer): self
{
if ($this->userAnswer->contains($userAnswer)) {
$this->userAnswer->removeElement($userAnswer);
// set the owning side to null (unless already changed)
if ($userAnswer->getUser() === $this) {
$userAnswer->setUser(null);
}
}
return $this;
}
/**
* @return Collection|UserTest[]
*/
public function getUserTest(): Collection
{
return $this->userTest;
}
public function addUserTest(UserTest $userTest): self
{
if (!$this->userTest->contains($userTest)) {
$this->userTest[] = $userTest;
$userTest->setUser($this);
}
return $this;
}
public function removeUserTest(UserTest $userTest): self
{
if ($this->userTest->contains($userTest)) {
$this->userTest->removeElement($userTest);
// set the owning side to null (unless already changed)
if ($userTest->getUser() === $this) {
$userTest->setUser(null);
}
}
return $this;
}
/**
* @return Collection|Test[]
*/
public function getTest(): Collection
{
return $this->test;
}
public function addTest(Test $test): self
{
if (!$this->test->contains($test)) {
$this->test[] = $test;
$test->setUser($this);
}
return $this;
}
public function removeTest(Test $test): self
{
if ($this->test->contains($test)) {
$this->test->removeElement($test);
// set the owning side to null (unless already changed)
if ($test->getUser() === $this) {
$test->setUser(null);
}
}
return $this;
}
public function getReginfo(): ?string
{
return $this->reginfo;
}
public function setReginfo(?string $reginfo): self
{
$this->reginfo = $reginfo;
return $this;
}
/**
* @return Collection|TouchPointAll[]
*/
public function getTouchPointAll(): Collection
{
return $this->touchPointAll;
}
public function addTouchPointAll(TouchPointAll $touchPointAll): self
{
if (!$this->touchPointAll->contains($touchPointAll)) {
$this->touchPointAll[] = $touchPointAll;
$touchPointAll->setUser($this);
}
return $this;
}
public function removeTouchPointAll(TouchPointAll $touchPointAll): self
{
if ($this->touchPointAll->contains($touchPointAll)) {
$this->touchPointAll->removeElement($touchPointAll);
// set the owning side to null (unless already changed)
if ($touchPointAll->getUser() === $this) {
$touchPointAll->setUser(null);
}
}
return $this;
}
public function getTempUniqskillsId(): ?int
{
return $this->tempUniqskillsId;
}
public function setTempUniqskillsId(?int $tempUniqskillsId): self
{
$this->tempUniqskillsId = $tempUniqskillsId;
return $this;
}
/**
* @return Collection|SalesManagoClient[]
*/
public function getSalesManagoClient(): Collection
{
return $this->salesManagoClient;
}
public function addSalesManagoClient(SalesManagoClient $salesManagoClient): self
{
if (!$this->salesManagoClient->contains($salesManagoClient)) {
$this->salesManagoClient[] = $salesManagoClient;
$salesManagoClient->setUser($this);
}
return $this;
}
public function removeSalesManagoClient(SalesManagoClient $salesManagoClient): self
{
if ($this->salesManagoClient->contains($salesManagoClient)) {
$this->salesManagoClient->removeElement($salesManagoClient);
// set the owning side to null (unless already changed)
if ($salesManagoClient->getUser() === $this) {
$salesManagoClient->setUser(null);
}
}
return $this;
}
/**
* @return Collection|PortalSettings[]
*/
public function getAccessToPortalSettings(): Collection
{
return $this->accessToPortalSettings;
}
public function addAccessToPortalSetting(PortalSettings $accessToPortalSetting): self
{
if (!$this->accessToPortalSettings->contains($accessToPortalSetting)) {
$this->accessToPortalSettings[] = $accessToPortalSetting;
}
return $this;
}
public function removeAccessToPortalSetting(PortalSettings $accessToPortalSetting): self
{
if ($this->accessToPortalSettings->contains($accessToPortalSetting)) {
$this->accessToPortalSettings->removeElement($accessToPortalSetting);
}
return $this;
}
public function getAccessToPortalSettingsIDs()
{
return $this->accessToPortalSettings->map(function($obj) {
return $obj->getId();
})->getValues();
}
public function getRegisteredFrom(): ?PortalSettings
{
return $this->registeredFrom;
}
public function setRegisteredFrom(?PortalSettings $registeredFrom): self
{
$this->registeredFrom = $registeredFrom;
return $this;
}
/**
* @return Collection|OrderError[]
*/
public function getOrdersError(): Collection
{
return $this->ordersError;
}
public function addOrdersError(OrderError $ordersError): self
{
if (!$this->ordersError->contains($ordersError)) {
$this->ordersError[] = $ordersError;
$ordersError->setUser($this);
}
return $this;
}
public function removeOrdersError(OrderError $ordersError): self
{
if ($this->ordersError->contains($ordersError)) {
$this->ordersError->removeElement($ordersError);
// set the owning side to null (unless already changed)
if ($ordersError->getUser() === $this) {
$ordersError->setUser(null);
}
}
return $this;
}
/**
* Set activationDate
*
* @param \DateTime $activationDate
*
* @return User
*/
public function setActivationDate($activationDate)
{
$this->activationDate = $activationDate;
return $this;
}
/**
* Get activationDate
*
* @return \DateTime
*/
public function getActivationDate()
{
return $this->activationDate;
}
public function setOrderDuringRegistration(Orders $order = null)
{
$this->orderDuringRegistration = $order;
return $this;
}
/**
* Get orderDuringRegistration
*
* @return \App\Entity\Gos\Orders
*/
public function getOrderDuringRegistration()
{
return $this->orderDuringRegistration;
}
/**
* Set campaign
*
* @param string $campaign
* @return User
*/
public function setCampaign($campaign)
{
$this->campaign = $campaign;
return $this;
}
/**
* Get campaign
*
* @return string
*/
public function getCampaign()
{
return $this->campaign;
}
/**
* Set campaignChannel
*
* @param string $campaignChannel
* @return User
*/
public function setCampaignChannel($campaignChannel)
{
$this->campaignChannel = $campaignChannel;
return $this;
}
public function getCampaignChannel(): ?string
{
return $this->campaignChannel;
}
/**
* @return Collection|BraintreeResponse[]
*/
public function getBraintreeResponse(): Collection
{
return $this->braintreeResponse;
}
public function addBraintreeResponse(BraintreeResponse $braintreeResponse): self
{
if (!$this->braintreeResponse->contains($braintreeResponse)) {
$this->braintreeResponse[] = $braintreeResponse;
$braintreeResponse->setUser($this);
}
return $this;
}
public function removeBraintreeResponse(BraintreeResponse $braintreeResponse): self
{
if ($this->braintreeResponse->contains($braintreeResponse)) {
$this->braintreeResponse->removeElement($braintreeResponse);
// set the owning side to null (unless already changed)
if ($braintreeResponse->getUser() === $this) {
$braintreeResponse->setUser(null);
}
}
return $this;
}
/**
* @return Collection|UserCertificate[]
*/
public function getUserCertificates(): Collection
{
return $this->userCertificates;
}
public function addUserCertificate(UserCertificate $userCertificate): self
{
if (!$this->userCertificates->contains($userCertificate)) {
$this->userCertificates[] = $userCertificate;
$userCertificate->setUser($this);
}
return $this;
}
public function removeUserCertificate(UserCertificate $userCertificate): self
{
if ($this->userCertificates->contains($userCertificate)) {
$this->userCertificates->removeElement($userCertificate);
// set the owning side to null (unless already changed)
if ($userCertificate->getUser() === $this) {
$userCertificate->setUser(null);
}
}
return $this;
}
public function getPosition(): ?UserPosition
{
return $this->position;
}
public function setPosition(?UserPosition $position): self
{
$this->position = $position;
return $this;
}
public function getAdditionalInformation(): Collection
{
return $this->additionalInformation;
}
public function addAdditionalInformation(UserAdditionalInfo $additionalInformation): self
{
if (!$this->additionalInformation->contains($additionalInformation)) {
$this->additionalInformation[] = $additionalInformation;
$additionalInformation->setUser($this);
}
return $this;
}
public function removeAdditionalInformation(UserAdditionalInfo $additionalInformation): self
{
if ($this->additionalInformation->contains($additionalInformation)) {
$this->additionalInformation->removeElement($additionalInformation);
if ($additionalInformation->getUser() === $this) {
$additionalInformation->setUser(null);
}
}
return $this;
}
public function getMarketing(): ?string
{
return $this->marketing;
}
public function setMarketing(?string $marketing): void
{
$this->marketing = $marketing;
}
/**
* @return Collection|UserFiles[]
*/
public function getUserFiles(): Collection
{
return $this->userFiles;
}
public function addUserFile(UserFiles $userFile): self
{
if (!$this->userFiles->contains($userFile)) {
$this->userFiles[] = $userFile;
$userFile->setUser($this);
}
return $this;
}
public function removeUserFile(UserFiles $userFile): self
{
if ($this->userFiles->contains($userFile)) {
$this->userFiles->removeElement($userFile);
// set the owning side to null (unless already changed)
if ($userFile->getUser() === $this) {
$userFile->setUser(null);
}
}
return $this;
}
public function getSendReminderActivation(): ?int
{
return $this->sendReminderActivation;
}
public function setSendReminderActivation(?int $sendReminderActivation): self
{
$this->sendReminderActivation = $sendReminderActivation;
return $this;
}
public function getEmployeeAccount(): ?bool
{
return $this->employeeAccount;
}
public function setEmployeeAccount(?bool $employeeAccount): self
{
$this->employeeAccount = $employeeAccount;
return $this;
}
public function getResettingCode()
{
return $this->resettingCode;
}
public function setResettingCode($resettingCode): void
{
$this->resettingCode = $resettingCode;
}
public function getActivationCode()
{
return $this->activationCode;
}
public function setActivationCode($activationCode): void
{
$this->activationCode = $activationCode;
}
/**
* @return mixed
*/
public function getFolders()
{
return $this->folders;
}
/**
* @param mixed $folders
*/
public function setFolders($folders): void
{
$this->folders = $folders;
}
/**
* @return mixed
*/
public function getSavedArticles()
{
return $this->savedArticles;
}
/**
* @param mixed $savedArticles
*/
public function setSavedArticles($savedArticles): void
{
$this->savedArticles = $savedArticles;
}
public function getFoldersArticlesUpdatedAt(): ?\DateTimeInterface
{
return $this->foldersArticlesUpdatedAt;
}
public function setFoldersArticlesUpdatedAt(?\DateTimeInterface $foldersArticlesUpdatedAt): self
{
$this->foldersArticlesUpdatedAt = $foldersArticlesUpdatedAt;
return $this;
}
public function getUserNotification(): Collection
{
return $this->userNotification;
}
public function hasNotificationForUser(NotificationForUser $notificationForUser): bool
{
/** @var UserNotification $userNotification */
foreach ($this->getUserNotification() as $userNotification)
{
if ($userNotification->getNotificationForUser() === $notificationForUser)
{
return true;
}
}
return false;
}
public function addUserNotification(UserNotification $userNotification): self
{
if (!$this->userNotification->contains($userNotification)) {
$this->userNotification[] = $userNotification;
$userNotification->setUser($this);
}
return $this;
}
public function removeUserNotification(userNotification $userNotification): self
{
if ($this->userNotification->contains($userNotification)) {
$this->userNotification->removeElement($userNotification);
if ($userNotification->getUser() === $this) {
$userNotification->setUser(null);
}
}
return $this;
}
/**
* @return Collection|FoLog[]
*/
public function getFoLogs(): Collection
{
return $this->foLogs;
}
public function addFoLog(FoLog $foLog): self
{
if (!$this->foLogs->contains($foLog)) {
$this->foLogs[] = $foLog;
$foLog->setUser($this);
}
return $this;
}
public function removeFoLog(FoLog $foLog): self
{
if ($this->foLogs->contains($foLog)) {
$this->foLogs->removeElement($foLog);
// set the owning side to null (unless already changed)
if ($foLog->getUser() === $this) {
$foLog->setUser(null);
}
}
return $this;
}
/**
* @return Collection|UserCard[]
*/
public function getUserCards(): Collection
{
return $this->userCards;
}
public function getActiveUserCardForOrder(Orders $order): ?UserCard
{
foreach ($this->getUserCards() as $userCard)
{
if ($userCard->getIsActive() && $userCard->getOrders() === $order)
{
return $userCard;
}
}
return null;
}
public function addUserCard(UserCard $userCard): self
{
if (!$this->userCards->contains($userCard)) {
$this->userCards[] = $userCard;
$userCard->setUser($this);
}
return $this;
}
public function removeUserCard(UserCard $userCard): self
{
if ($this->userCards->contains($userCard)) {
$this->userCards->removeElement($userCard);
// set the owning side to null (unless already changed)
if ($userCard->getUser() === $this) {
$userCard->setUser(null);
}
}
return $this;
}
/**
* @return Collection|UserVideoNotes[]
*/
public function getUserVideoNotes(): Collection
{
return $this->userVideoNotes;
}
public function addUserVideoNote(UserVideoNotes $userVideoNote): self
{
if (!$this->userVideoNotes->contains($userVideoNote)) {
$this->userVideoNotes[] = $userVideoNote;
$userVideoNote->setUser($this);
}
return $this;
}
public function removeUserVideoNote(UserVideoNotes $userVideoNote): self
{
if ($this->userVideoNotes->contains($userVideoNote)) {
$this->userVideoNotes->removeElement($userVideoNote);
// set the owning side to null (unless already changed)
if ($userVideoNote->getUser() === $this) {
$userVideoNote->setUser(null);
}
}
return $this;
}
/**
* @return Collection|EventNotificationScheduler[]
*/
public function getEventNotificationSchedulers(): Collection
{
return $this->eventNotificationSchedulers;
}
public function addEventNotificationScheduler(EventNotificationScheduler $eventNotificationScheduler): self
{
if (!$this->eventNotificationSchedulers->contains($eventNotificationScheduler)) {
$this->eventNotificationSchedulers[] = $eventNotificationScheduler;
$eventNotificationScheduler->setUser($this);
}
return $this;
}
public function removeEventNotificationScheduler(EventNotificationScheduler $eventNotificationScheduler): self
{
if ($this->eventNotificationSchedulers->contains($eventNotificationScheduler)) {
$this->eventNotificationSchedulers->removeElement($eventNotificationScheduler);
// set the owning side to null (unless already changed)
if ($eventNotificationScheduler->getUser() === $this) {
$eventNotificationScheduler->setUser(null);
}
}
return $this;
}
/**
* @return Collection|Events[]
*/
public function getPresenceOnEvents(): Collection
{
return $this->presenceOnEvents;
}
public function addPresenceOnEvent(Events $event): self
{
if (!$this->presenceOnEvents->contains($event))
{
$this->presenceOnEvents[] = $event;
$event->addPresentUser($this);
}
return $this;
}
public function removePresenceOnEvent(Events $event): self
{
if ($this->presenceOnEvents->contains($event))
{
$this->presenceOnEvents->removeElement($event);
$event->removePresentUser($this);
}
return $this;
}
public function getOneTimePassword(): ?string
{
return $this->oneTimePassword;
}
public function setOneTimePassword(?string $oneTimePassword): self
{
$this->oneTimePassword = $oneTimePassword;
return $this;
}
public function getOtpToken(): ?string
{
return $this->otpToken;
}
public function setOtpToken(?string $otpToken): self
{
$this->otpToken = $otpToken;
return $this;
}
/**
* @return Collection|UserFirstLoginInfo[]
*/
public function getUserFirstLoginInfos(): Collection
{
return $this->userFirstLoginInfos;
}
public function addUserFirstLoginInfo(UserFirstLoginInfo $userFirstLoginInfo): self
{
if (!$this->userFirstLoginInfos->contains($userFirstLoginInfo)) {
$this->userFirstLoginInfos[] = $userFirstLoginInfo;
$userFirstLoginInfo->setUser($this);
}
return $this;
}
public function removeUserFirstLoginInfo(UserFirstLoginInfo $userFirstLoginInfo): self
{
if ($this->userFirstLoginInfos->contains($userFirstLoginInfo)) {
$this->userFirstLoginInfos->removeElement($userFirstLoginInfo);
// set the owning side to null (unless already changed)
if ($userFirstLoginInfo->getUser() === $this) {
$userFirstLoginInfo->setUser(null);
}
}
return $this;
}
/**
* @return Collection|UserDevices[]
*/
public function getUserDevices(): Collection
{
return $this->userDevices;
}
public function addUserDevice(UserDevices $userDevice): self
{
if (!$this->userDevices->contains($userDevice)) {
$this->userDevices[] = $userDevice;
$userDevice->setUser($this);
}
return $this;
}
public function removeUserDevice(UserDevices $userDevice): self
{
if ($this->userDevices->contains($userDevice)) {
$this->userDevices->removeElement($userDevice);
// set the owning side to null (unless already changed)
if ($userDevice->getUser() === $this) {
$userDevice->setUser(null);
}
}
return $this;
}
public function getDeviceAuthCode(): ?string
{
return $this->deviceAuthCode;
}
public function setDeviceAuthCode(?string $deviceAuthCode): self
{
$this->deviceAuthCode = $deviceAuthCode;
return $this;
}
public function getDeviceAuthToken(): ?string
{
return $this->deviceAuthToken;
}
public function setDeviceAuthToken(?string $deviceAuthToken): self
{
$this->deviceAuthToken = $deviceAuthToken;
return $this;
}
/**
* @return Collection|VirtualCurrencyWallet[]
*/
public function getVirtualCurrencyWallets(): Collection
{
return $this->virtualCurrencyWallets;
}
public function addVirtualCurrencyWallet(VirtualCurrencyWallet $virtualCurrencyWallet): self
{
if (!$this->virtualCurrencyWallets->contains($virtualCurrencyWallet)) {
$this->virtualCurrencyWallets[] = $virtualCurrencyWallet;
$virtualCurrencyWallet->setUser($this);
}
return $this;
}
public function removeVirtualCurrencyWallet(VirtualCurrencyWallet $virtualCurrencyWallet): self
{
if ($this->virtualCurrencyWallets->contains($virtualCurrencyWallet)) {
$this->virtualCurrencyWallets->removeElement($virtualCurrencyWallet);
// set the owning side to null (unless already changed)
if ($virtualCurrencyWallet->getUser() === $this) {
$virtualCurrencyWallet->setUser(null);
}
}
return $this;
}
/**
* @return Collection|VirtualCurrencyTransaction[]
*/
public function getVirtualCurrencyTransactions(): Collection
{
return $this->virtualCurrencyTransactions;
}
public function addVirtualCurrencyTransaction(VirtualCurrencyTransaction $virtualCurrencyTransaction): self
{
if (!$this->virtualCurrencyTransactions->contains($virtualCurrencyTransaction)) {
$this->virtualCurrencyTransactions[] = $virtualCurrencyTransaction;
$virtualCurrencyTransaction->setUser($this);
}
return $this;
}
public function removeVirtualCurrencyTransaction(VirtualCurrencyTransaction $virtualCurrencyTransaction): self
{
if ($this->virtualCurrencyTransactions->contains($virtualCurrencyTransaction)) {
$this->virtualCurrencyTransactions->removeElement($virtualCurrencyTransaction);
// set the owning side to null (unless already changed)
if ($virtualCurrencyTransaction->getUser() === $this) {
$virtualCurrencyTransaction->setUser(null);
}
}
return $this;
}
/**
* @return Collection|VirtualCurrencyOrder[]
*/
public function getVirtualCurrencyOrders(): Collection
{
return $this->virtualCurrencyOrders;
}
public function addVirtualCurrencyOrder(VirtualCurrencyOrder $virtualCurrencyOrder): self
{
if (!$this->virtualCurrencyOrders->contains($virtualCurrencyOrder)) {
$this->virtualCurrencyOrders[] = $virtualCurrencyOrder;
$virtualCurrencyOrder->setUser($this);
}
return $this;
}
public function removeVirtualCurrencyOrder(VirtualCurrencyOrder $virtualCurrencyOrder): self
{
if ($this->virtualCurrencyOrders->contains($virtualCurrencyOrder)) {
$this->virtualCurrencyOrders->removeElement($virtualCurrencyOrder);
// set the owning side to null (unless already changed)
if ($virtualCurrencyOrder->getUser() === $this) {
$virtualCurrencyOrder->setUser(null);
}
}
return $this;
}
/**
* @return Collection|SmsCode[]
*/
public function getSmsCodes(): Collection
{
return $this->smsCodes;
}
public function addSmsCode(SmsCode $smsCode): self
{
if (!$this->smsCodes->contains($smsCode)) {
$this->smsCodes[] = $smsCode;
$smsCode->setUser($this);
}
return $this;
}
public function removeSmsCode(SmsCode $smsCode): self
{
if ($this->smsCodes->contains($smsCode)) {
$this->smsCodes->removeElement($smsCode);
// set the owning side to null (unless already changed)
if ($smsCode->getUser() === $this) {
$smsCode->setUser(null);
}
}
return $this;
}
public function findUserPhoneNumber(): ?string
{
if ($this->phoneNumber)
{
return $this->phoneNumber;
}
if ($this->getAddress() && $this->getAddress()->getPhone())
{
return $this->getAddress()->getPhone();
}
return null;
}
/**
* @return Collection|Email[]
*/
public function getEmails(): Collection
{
return $this->emails;
}
public function addEmail(Email $email): self
{
if (!$this->emails->contains($email)) {
$this->emails[] = $email;
$email->setUser($this);
}
return $this;
}
public function removeEmail(Email $email): self
{
if ($this->emails->contains($email)) {
$this->emails->removeElement($email);
// set the owning side to null (unless already changed)
if ($email->getUser() === $this) {
$email->setUser(null);
}
}
return $this;
}
/**
* @return Collection|LoginHistory[]
*/
public function getLoginHistories(): Collection
{
return $this->loginHistories;
}
public function addLoginHistory(LoginHistory $loginHistory): self
{
if (!$this->loginHistories->contains($loginHistory)) {
$this->loginHistories[] = $loginHistory;
$loginHistory->setUser($this);
}
return $this;
}
public function removeLoginHistory(LoginHistory $loginHistory): self
{
if ($this->loginHistories->contains($loginHistory)) {
$this->loginHistories->removeElement($loginHistory);
// set the owning side to null (unless already changed)
if ($loginHistory->getUser() === $this) {
$loginHistory->setUser(null);
}
}
return $this;
}
/**
* @return Collection|UserCertificatePath[]
*/
public function getUserCertificatePaths(): Collection
{
return $this->userCertificatePaths;
}
public function addUserCertificatePath(UserCertificatePath $userCertificatePath): self
{
if (!$this->userCertificatePaths->contains($userCertificatePath)) {
$this->userCertificatePaths[] = $userCertificatePath;
$userCertificatePath->setUser($this);
}
return $this;
}
public function removeUserCertificatePath(UserCertificatePath $userCertificatePath): self
{
if ($this->userCertificatePaths->contains($userCertificatePath)) {
$this->userCertificatePaths->removeElement($userCertificatePath);
// set the owning side to null (unless already changed)
if ($userCertificatePath->getUser() === $this) {
$userCertificatePath->setUser(null);
}
}
return $this;
}
/**
* @return Collection|ProductReleaseNotify[]
*/
public function getProductReleaseNotifies(): Collection
{
return $this->productReleaseNotifies;
}
public function addProductReleaseNotify(ProductReleaseNotify $productReleaseNotify): self
{
if (!$this->productReleaseNotifies->contains($productReleaseNotify)) {
$this->productReleaseNotifies[] = $productReleaseNotify;
$productReleaseNotify->setUser($this);
}
return $this;
}
public function removeProductReleaseNotify(ProductReleaseNotify $productReleaseNotify): self
{
if ($this->productReleaseNotifies->contains($productReleaseNotify)) {
$this->productReleaseNotifies->removeElement($productReleaseNotify);
// set the owning side to null (unless already changed)
if ($productReleaseNotify->getUser() === $this) {
$productReleaseNotify->setUser(null);
}
}
return $this;
}
public function getLastFailureDiaboloResponseAt(): ?\DateTimeInterface
{
return $this->lastFailureDiaboloResponseAt;
}
public function setLastFailureDiaboloResponseAt(?\DateTimeInterface $lastFailureDiaboloResponseAt): self
{
$this->lastFailureDiaboloResponseAt = $lastFailureDiaboloResponseAt;
return $this;
}
/**
* @return Collection|UserRenewalOffer[]
*/
public function getUserRenewalOffers(): Collection
{
return $this->userRenewalOffers;
}
public function addUserRenewalOffer(UserRenewalOffer $userRenewalOffer): self
{
if (!$this->userRenewalOffers->contains($userRenewalOffer)) {
$this->userRenewalOffers[] = $userRenewalOffer;
$userRenewalOffer->setUser($this);
}
return $this;
}
public function removeUserRenewalOffer(UserRenewalOffer $userRenewalOffer): self
{
if ($this->userRenewalOffers->contains($userRenewalOffer)) {
$this->userRenewalOffers->removeElement($userRenewalOffer);
// set the owning side to null (unless already changed)
if ($userRenewalOffer->getUser() === $this) {
$userRenewalOffer->setUser(null);
}
}
return $this;
}
public function getUsingPortals(): Collection
{
return $this->usingPortals;
}
public function addUsingPortal(PortalSettings $usingPortal): self
{
if (!$this->usingPortals->contains($usingPortal)) {
$this->usingPortals[] = $usingPortal;
}
return $this;
}
public function removeUsingPortal(PortalSettings $usingPortal): self
{
if ($this->usingPortals->contains($usingPortal)) {
$this->usingPortals->removeElement($usingPortal);
}
return $this;
}
/**
* @return Collection|AssignedUserFlag[]
*/
public function getAssignedFlags(): Collection
{
return $this->assignedFlags;
}
public function addAssignedFlag(AssignedUserFlag $assignedFlag): self
{
if (!$this->assignedFlags->contains($assignedFlag)) {
$this->assignedFlags[] = $assignedFlag;
$assignedFlag->setUser($this);
}
return $this;
}
public function removeAssignedFlag(AssignedUserFlag $assignedFlag): self
{
if ($this->assignedFlags->contains($assignedFlag)) {
$this->assignedFlags->removeElement($assignedFlag);
// set the owning side to null (unless already changed)
if ($assignedFlag->getUser() === $this) {
$assignedFlag->setUser(null);
}
}
return $this;
}
/**
* @return Collection|OrderProductVariantOmittedUpsell[]
*/
public function getOrderProductVariantOmittedUpsells(): Collection
{
return $this->orderProductVariantOmittedUpsells;
}
public function addOrderProductVariantOmittedUpsell(OrderProductVariantOmittedUpsell $orderProductVariantOmittedUpsell): self
{
if (!$this->orderProductVariantOmittedUpsells->contains($orderProductVariantOmittedUpsell)) {
$this->orderProductVariantOmittedUpsells[] = $orderProductVariantOmittedUpsell;
$orderProductVariantOmittedUpsell->setUser($this);
}
return $this;
}
public function removeOrderProductVariantOmittedUpsell(OrderProductVariantOmittedUpsell $orderProductVariantOmittedUpsell): self
{
if ($this->orderProductVariantOmittedUpsells->contains($orderProductVariantOmittedUpsell)) {
$this->orderProductVariantOmittedUpsells->removeElement($orderProductVariantOmittedUpsell);
// set the owning side to null (unless already changed)
if ($orderProductVariantOmittedUpsell->getUser() === $this) {
$orderProductVariantOmittedUpsell->setUser(null);
}
}
return $this;
}
public function getNpwz(): ?int
{
return $this->npwz;
}
public function setNpwz(?int $npwz): self
{
$this->npwz = $npwz;
return $this;
}
public function isDarkModeActive(): ?bool
{
return $this->isDarkModeActive;
}
public function setIsDarkModeActive(int $isDarkModeActive): User
{
$this->isDarkModeActive = $isDarkModeActive;
return $this;
}
public function getGetResponseContactId(): ?string
{
return $this->getResponseContactId;
}
public function setGetResponseContactId(?string $getResponseContactId): self
{
$this->getResponseContactId = $getResponseContactId;
return $this;
}
/**
* @return mixed
*/
public function getIsRobinson()
{
return $this->isRobinson;
}
/**
* @param mixed $isRobinson
* @return User
*/
public function setIsRobinson($isRobinson)
{
$this->isRobinson = $isRobinson;
return $this;
}
public function getSalesmanago2ContactId(): ?string
{
return $this->salesmanago2ContactId;
}
public function setSalesmanago2ContactId(?string $salesmanago2ContactId): self
{
$this->salesmanago2ContactId = $salesmanago2ContactId;
return $this;
}
public function existsInDb(): bool
{
try
{
$this->getEmail();
}
catch (EntityNotFoundException $e)
{
return false;
}
return true;
}
}