<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Symfony\Component\HttpFoundation\File\File as HttpFile;
use Symfony\Component\Security\Core\User\UserInterface;
//use Symfony\Component\Security\Core\User\AdvancedUserInterface;
use Doctrine\ORM\Mapping as ORM;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
* @Vich\Uploadable
*/
class User implements UserInterface, /*AdvancedUserInterface,*/ \Serializable
{
const ROLE_NONE = 0;
const ROLE_USER = 1;
const ROLE_MANAGER = 4;
const ROLE_ADMIN = 8;
const ROLE_SOCIAL_ADMIN = 10;
const ROLE_SUPER_ADMIN = 16;
const STATUS_ACTIVE = 1;
const STATUS_INACTIVE = 0;
const STATUS_BANNED = -3;
const STATUS_SPAM = -4;
const MEMBERSHIP_NONE = 0;
const MEMBERSHIP_INDIVIDUAL = 1;
const MEMBERSHIP_COMPANY = 2;
const MEMBERSHIP_PREMIUM = 3;
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="bigint")
*/
private $id;
/**
* @ORM\Version @ORM\Column(type="integer")
*/
private $version;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @var string
*/
protected $image;
/**
* @Vich\UploadableField(mapping="user_images", fileNameProperty="image")
* @var File
*/
protected $imageFile;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Media", cascade={"persist"})
* @ORM\JoinColumn(nullable=true)
*/
private $media;
/**
* @ORM\Column(type="string", length=64, unique=true)
*/
private $username;
/**
* @ORM\Column(type="string", length=255)
*/
private $password;
/**
* @ORM\Column(type="string", length=191, unique=true)
*/
private $email;
/**
* @ORM\Column(type="string", length=64)
*/
private $firstname;
/**
* @ORM\Column(type="string", length=64)
*/
private $lastname;
/**
* @ORM\Column(type="string", length=128)
*/
private $displayname;
/**
* @ORM\Column(type="integer")
*/
private $role;
/**
* @ORM\Column(type="integer")
*/
private $type;
/**
* @ORM\Column(type="integer")
*/
private $status;
/**
* @ORM\Column(type="integer")
*/
private $member;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $member_expires;
/**
* @ORM\OneToMany(targetEntity="App\Entity\UserMeta", mappedBy="user", orphanRemoval=true, cascade={"persist"})
*/
private $usermeta;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Content", mappedBy="author")
* @ORM\OrderBy({"id" = "DESC"})
*/
private $content;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Quiz", mappedBy="author")
*/
private $quizzes;
/**
* @ORM\OneToMany(targetEntity="App\Entity\QuizResponse", mappedBy="user")
*/
private $quizResponses;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Lead", mappedBy="user", orphanRemoval=true, cascade={"persist", "remove"})
* @ORM\OrderBy({"id" = "DESC"})
*/
private $leads;
/**
* @ORM\Column(type="datetime")
*/
private $created_at;
/**
* @ORM\Column(type="datetime")
*/
private $modified_at;
/**
* @ORM\OneToMany(targetEntity="App\Entity\PurchaseNote", mappedBy="author")
*/
private $purchaseNotes;
/**
* @ORM\OneToMany(targetEntity="App\Entity\ContactNote", mappedBy="author")
*/
private $contactNotes;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $activation_token;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $activation_expires;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $reset_pw_token;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $reset_pw_expires;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $mfa_token;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $mfa_code;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $mfa_token_expires;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Customer", mappedBy="members")
*/
private $companies;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Comment", mappedBy="user")
*/
private $comments;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Purchase", mappedBy="user")
* @ORM\OrderBy({"purchased_at" = "DESC"})
*/
private $purchases;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Traffic", mappedBy="user", orphanRemoval=true, cascade={"persist", "remove"})
*/
private $traffic;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Contact", inversedBy="users", cascade={"persist"})
* @ORM\JoinColumn(name="contact_id", referencedColumnName="id", nullable=true)
*/
private $contact;
/**
* @ORM\OneToMany(targetEntity="App\Entity\PollResponse", mappedBy="user", orphanRemoval=true, cascade={"persist", "remove"}, fetch="EAGER")
*/
private $pollResponses;
/**
* @ORM\Column(type="integer")
*/
private $site_signed_up_on;
/**
* @ORM\Column(type="text")
*/
private $author_bio;
public function __construct()
{
// $this->isActive = false;
$this->firstname = "";
$this->lastname = "";
$this->displayname = "";
$this->site_signed_up_on = 0;
$this->type = 1;
$this->role = self::ROLE_USER;
$this->status = SELF::STATUS_INACTIVE;
$this->member = SELF::MEMBERSHIP_NONE;
// email tokens
$this->activation_token = "";
$this->reset_pw_token = "";
$this->mfa_token = "";
$this->mfa_code = "";
$this->usermeta = new ArrayCollection();
$this->content = new ArrayCollection();
$this->leads = new ArrayCollection();
// can we give them a default avatar if not set? - probably should pull from the getter...
// $this->setImageFile("")
$this->modified_at = new \DateTime();
$this->created_at = new \DateTime();
$this->quizzes = new ArrayCollection();
$this->quizResponses = new ArrayCollection();
$this->purchaseNotes = new ArrayCollection();
$this->contactNotes = new ArrayCollection();
$this->companies = new ArrayCollection();
$this->comments = new ArrayCollection();
$this->purchases = new ArrayCollection();
$this->author_bio = "";
}
public function getId()
{
return $this->id;
}
public function getVersion() {
return $this->version;
}
public function setUsername(string $username = null): self
{
$this->username = $username ? $username : "";
return $this;
}
/*
public function getPasshash(): ?string
{
return $this->passhash;
}
public function setPasshash(string $passhash): self
{
$this->passhash = $passhash;
return $this;
}
*/
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email = null): self
{
$this->email = $email ? $email : "";
return $this;
}
public function getFirstname(): ?string
{
return $this->firstname;
}
public function setFirstname(string $firstname = null): self
{
$this->firstname = $firstname ? $firstname : "";
return $this;
}
public function getLastname(): ?string
{
return $this->lastname;
}
public function setLastname(string $lastname = null): self
{
$this->lastname = $lastname ? $lastname : "";
return $this;
}
public function getDisplayname(): ?string
{
return $this->displayname ? $this->displayname : $this->getUsername();
}
public function setDisplayname(string $displayname = null): self
{
$this->displayname = $displayname ? $displayname : "";
return $this;
}
public function getByline()
{
if ($this->firstname && $this->lastname) {
return "By {$this->firstname} {$this->lastname}.";
}
if ($this->displayname) {
return "By {$this->displayname}.";
}
$return = "";
}
public function getRole(): ?int
{
return $this->role;
}
public function setRole(?int $role): self
{
$role = (int) $role;
$this->role = $role;
return $this;
}
public function isAdmin()
{
return $this->role >= self::ROLE_ADMIN;
}
public function isSocialAdmin()
{
return $this->role >= self::ROLE_SOCIAL_ADMIN;
}
public function isSuperAdmin()
{
return $this->role == self::ROLE_SUPER_ADMIN;
}
public function getType(): ?int
{
return $this->type;
}
public function setType(int $type): self
{
$this->type = $type;
return $this;
}
public function getStatus(): ?int
{
return $this->status;
}
public function setStatus(int $status): self
{
$this->status = $status;
return $this;
}
public function getMember(): ?int
{
return $this->member;
}
public function setMember(int $member): self
{
$this->member = $member;
return $this;
}
/*
public function getMember(): ?bool
{
return $this->member == 1;
}
public function setMember(bool $value): self
{
$this->member = $value ? 1 : 0;
return $this;
}
*/
public function isMember(): ?bool
{
return ($this->getMember() > 0) ? true : false;
}
public function getMemberExpires(): ?\DateTimeInterface
{
return $this->member_expires;
}
public function setMemberExpires(\DateTimeInterface $member_expires = null): self
{
$this->member_expires = $member_expires;
return $this;
}
/**
* @return Collection|UserMeta[]
*/
public function getUsermeta(): Collection
{
return $this->usermeta;
}
public function getUserMetaByKey ($key = "")
{
foreach ($this->usermeta as $meta) {
if ($meta->getMetakey() == $key) {
return $meta;
}
}
return null;
}
public function getUserMetaValueByKey ($key = "")
{
$meta = $this->getUserMetaByKey($key);
if ($meta) {
return $meta->getMetaValue();
}
return "";
}
// sets the content meta with the provided certain key / value, or changes it if one with that key already exists
public function setUsermetum($key = "", $value = "")
{
$meta = $this->getUserMetaByKey($key);
if ($meta) {
$meta->setMetavalue($value);
}
else {
$meta = new UserMeta();
$meta->setMetakey($key);
$meta->setMetavalue($value);
$this->addUsermetum($meta);
}
}
// adds content meta, even if one with that key already exists
public function addUsermetum(UserMeta $usermetum): self
{
if (!$this->usermeta->contains($usermetum)) {
$this->usermeta[] = $usermetum;
$usermetum->setUser($this);
}
return $this;
}
public function removeUsermetum(UserMeta $usermetum): self
{
if ($this->usermeta->contains($usermetum)) {
$this->usermeta->removeElement($usermetum);
// set the owning side to null (unless already changed)
if ($usermetum->getUser() === $this) {
$usermetum->setUser(null);
}
}
return $this;
}
/**
* @return Collection|Content[]
*/
public function getContent(): Collection
{
return $this->content;
}
public function addContent(Content $content): self
{
if (!$this->content->contains($content)) {
$this->content[] = $content;
$content->setAuthor($this);
}
return $this;
}
public function removeContent(Content $content): self
{
if ($this->content->contains($content)) {
$this->content->removeElement($content);
// set the owning side to null (unless already changed)
if ($content->getAuthor() === $this) {
$content->setAuthor(null);
}
}
return $this;
}
public function getForumTopics ()
{
$content = $this->getContent();
$return = [];
foreach ($content as $c) {
if ($c->getType() == Content::FORUM_TOPIC) {
$return[] = $c;
}
}
return new ArrayCollection($return);
}
public function getForumReplies ()
{
$content = $this->getContent();
$return = [];
foreach ($content as $c) {
if ($c->getType() == Content::FORUM_REPLY) {
$return[] = $c;
}
}
return new ArrayCollection($return);
}
public function markAsSpam (): self
{
$this->setStatus(User::STATUS_SPAM);
$content = $this->getContent();
foreach ($content as $c) {
if($c->getStatus() == Content::STATUS_ACTIVE) {
$c->setStatus(Content::STATUS_SPAM);
}
}
//should we set child content status too?
return $this;
}
public function unmarkAsSpam (): self
{
$this->setStatus(User::STATUS_ACTIVE);
$content = $this->getContent();
foreach ($content as $c) {
if($c->getStatus() == Content::STATUS_SPAM) {
$c->setStatus(Content::STATUS_ACTIVE);
}
}
//should we set child content status too?
return $this;
}
/**
* @return Collection|Lead[]
*/
public function getLeads(): Collection
{
return $this->leads;
}
public function addLead(Lead $lead): self
{
if (!$this->leads->contains($lead)) {
$this->leads[] = $lead;
$lead->setUser($this);
}
return $this;
}
public function removeLead(Lead $lead): self
{
if ($this->leads->contains($lead)) {
$this->leads->removeElement($lead);
// set the owning side to null (unless already changed)
if ($lead->getUser() === $this) {
$lead->setUser(null);
}
}
return $this;
}
public function __toString ()
{
return $this->username ? $this->username : '';
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeInterface $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getModifiedAt(): ?\DateTimeInterface
{
return $this->modified_at;
}
public function setModifiedAt(\DateTimeInterface $modified_at): self
{
$this->modified_at = $modified_at;
return $this;
}
// image getters / setters
// public function setImageFile(File $image = null)
public function setImageFile(HttpFile $image = null)
{
$this->imageFile = $image;
// VERY IMPORTANT:
// 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
if ($image) {
// if 'updatedAt' is not defined in your entity, use another property
$this->modified_at = new \DateTime("now");
}
}
public function getImageFile()
{
return $this->imageFile;
}
public function setImage($image)
{
$this->image = $image;
return $this;
}
public function getImage()
{
return $this->image;
}
public function removeAvatar ()
{
if ($this->image) {
$file = dirname(dirname(dirname(__FILE__)))."/public/uploads/users/{$this->image}";
if (is_file($file)) {
unlink($file);
}
$this->imageFile = null;
$this->image = "";
$this->modified_at = new \DateTime("now");
}
}
public function getAvatarURL()
{
if($this->media) {
return $this->media->getURL();
}
elseif ($this->image) {
return "/uploads/users/{$this->image}";
} else {
return "/assets/img/default-user.jpg";
}
}
public function getMedia (): ?Media
{
return $this->media;
}
public function setMedia (Media $media = null): self
{
$this->media = $media;
return $this;
}
/**
* @return Collection|Quiz[]
*/
public function getquizzes(): Collection
{
return $this->quizzes;
}
public function addQuiz(Quiz $quiz): self
{
if (!$this->quizzes->contains($quiz)) {
$this->quizzes[] = $quiz;
$quiz->setAuthor($this);
}
}
public function removeQuiz(Quiz $quiz): self
{
if ($this->quizzes->contains($quiz)) {
$this->quizzes->removeElement($quiz);
// set the owning side to null (unless already changed)
if ($quiz->getAuthor() === $this) {
$quiz->setAuthor(null);
}
}
}
/**
* @return Collection|QuizResponse[]
*/
public function getQuizResponses(): Collection
{
return $this->quizResponses;
}
public function addQuizResponse(QuizResponse $quizResponse): self
{
if (!$this->quizResponses->contains($quizResponse)) {
$this->quizResponses[] = $quizResponse;
$quizResponse->setUser($this);
}
}
public function removeQuizResponse(QuizResponse $quizResponse): self
{
if ($this->quizResponses->contains($quizResponse)) {
$this->quizResponses->removeElement($quizResponse);
// set the owning side to null (unless already changed)
if ($quizResponse->getUser() === $this) {
$quizResponse->setUser(null);
}
}
}
/**
* @return Collection|PurchaseNote[]
*/
public function getPurchaseNotes(): Collection
{
return $this->purchaseNotes;
}
public function addPurchaseNote(PurchaseNote $orderNote): self
{
if (!$this->purchaseNotes->contains($orderNote)) {
$this->purchaseNotes[] = $orderNote;
$orderNote->setAuthorId($this);
}
}
public function removeOrderNote(PurchaseNote $orderNote): self
{
if ($this->purchaseNotes->contains($orderNote)) {
$this->purchaseNotes->removeElement($orderNote);
// set the owning side to null (unless already changed)
if ($orderNote->getAuthorId() === $this) {
$orderNote->setAuthorId(null);
}
}
}
/**
* @return Collection|ContactNote[]
*/
public function getContactNotes(): Collection
{
return $this->contactNotes;
}
public function addContactNote(ContactNote $contactNote): self
{
if (!$this->contactNotes->contains($contactNote)) {
$this->contactNotes[] = $contactNote;
$contactNote->setAuthorId($this);
}
}
public function removeContactNote(ContactNote $contactNote): self
{
if ($this->contactNotes->contains($contactNote)) {
$this->contactNotes->removeElement($contactNote);
// set the owning side to null (unless already changed)
if ($contactNote->getAuthorId() === $this) {
$contactNote->setAuthorId(null);
}
}
}
public function getActivationToken(): ?string
{
return $this->activation_token;
}
public function setActivationToken(string $activation_token = null): self
{
$this->activation_token = $activation_token;
return $this;
}
public function getActivationExpires(): ?\DateTimeInterface
{
return $this->activation_expires;
}
public function setActivationExpires(\DateTimeInterface $activation_expires = null): self
{
$this->activation_expires = $activation_expires;
return $this;
}
public function getResetPwToken(): ?string
{
return $this->reset_pw_token;
}
public function setResetPwToken(string $reset_pw_token = null): self
{
$this->reset_pw_token = $reset_pw_token;
return $this;
}
public function getResetPwExpires(): ?\DateTimeInterface
{
return $this->reset_pw_expires;
}
public function setResetPwExpires(\DateTimeInterface $reset_pw_expires = null): self
{
$this->reset_pw_expires = $reset_pw_expires;
return $this;
}
public function getMfaToken(): ?string
{
return $this->mfa_token;
}
public function setMfaToken(string $mfa_token = null): self
{
$this->mfa_token = $mfa_token;
return $this;
}
public function getMfaCode(): ?string
{
return $this->mfa_code;
}
public function setMfaCode(string $mfa_code = null): self
{
$this->mfa_code = $mfa_code;
return $this;
}
public function getMfaTokenExpires(): ?\DateTimeInterface
{
return $this->mfa_token_expires;
}
public function setMfaTokenExpires(\DateTimeInterface $mfa_token_expires = null): self
{
$this->mfa_token_expires = $mfa_token_expires;
return $this;
}
/**
* @return Collection|Customer[]
*/
public function getCompanies(): Collection
{
return $this->companies;
}
public function inCompany(Customer $company): ?bool
{
return $this->companies->contains($company);
}
public function addCompany(Customer $company): self
{
if (!$this->companies->contains($company)) {
$this->companies[] = $company;
$company->addMember($this);
}
return $this;
}
public function removeCompany(Customer $company): self
{
if ($this->companies->contains($company)) {
$this->companies->removeElement($company);
$company->removeMember($this);
}
return $this;
}
public function getFullName ()
{
if ($this->firstname && $this->lastname) {
return "{$this->firstname} {$this->lastname}";
}
if ($this->displayname) {
return $this->displayname;
}
// if nothing else - return username
return $this->username;
}
// UserInterface
// ===================
public function getRoles ()
{
$roles = array ();
if ($this->role == 1) {
$roles[] = "ROLE_USER";
}
if ($this->role == 4) {
$roles[] = "ROLE_USER";
$roles[] = "ROLE_MANAGER";
}
if ($this->role == 8) {
$roles[] = "ROLE_USER";
$roles[] = "ROLE_MANAGER";
$roles[] = "ROLE_ADMIN";
$roles[] = "ROLE_ALLOWED_TO_SWITCH";
}
if ($this->role == 10) {
$roles[] = "ROLE_USER";
$roles[] = "ROLE_MANAGER";
$roles[] = "ROLE_ADMIN";
$roles[] = "ROLE_SOCIAL_ADMIN";
$roles[] = "ROLE_ALLOWED_TO_SWITCH";
}
if ($this->role == 16) {
$roles[] = "ROLE_USER";
$roles[] = "ROLE_MANAGER";
$roles[] = "ROLE_ADMIN";
$roles[] = "ROLE_ALLOWED_TO_SWITCH";
$roles[] = "ROLE_SUPER_ADMIN";
}
/*
var_dump($roles);
exit;
*/
return $roles;
}
public function getUsername(): ?string
{
return $this->username ? $this->username : "";
}
public function getPassword ()
{
return $this->password;
}
public function setPassword ($password = "")
{
$this->password = $password;
return $this;
}
public function getSalt ()
{
// bcrypt generates its own salt
return null;
}
public function eraseCredentials ()
{
}
// AdvancedUserInterface
// =======================
public function isAccountNonExpired ()
{
return true;
}
public function isAccountNonLocked ()
{
return true;
}
public function isCredentialsNonExpired ()
{
return true;
}
public function isEnabled ()
{
// return ($this->isActive && (0 < $this->status));
return (0 < $this->status);
}
// Serializable
// ==================
public function serialize ()
{
return serialize(array(
$this->id,
$this->username,
$this->password,
$this->role,
$this->status,
// $this->isActive
));
}
public function unserialize ($serialized)
{
list (
$this->id,
$this->username,
$this->password,
$this->role,
$this->status,
// $this->isActive
) = unserialize($serialized, array ("allowed_classes" => false));
}
/**
* @return Collection|Order[]
*/
public function getPurchases(): Collection
{
return $this->purchases;
}
public function getActivePurchase(): ?Purchase
{
for ($i = 0; $i < count($this->purchases); $i++) {
if ($this->purchases[$i]->getStatus() == Purchase::STATUS_ACTIVE) {
return $this->purchases[$i];
}
}
return null;
}
public function addPurchase(Purchase $order): self
{
if (!$this->purchases->contains($order)) {
$this->purchases[] = $order;
$order->setUser($this);
}
return $this;
}
public function removePurchase(Purchase $order): self
{
if ($this->purchases->contains($order)) {
$this->purchases->removeElement($order);
// set the owning side to null (unless already changed)
if ($order->getUser() === $this) {
$order->setUser(null);
}
}
return $this;
}
public function countCouponUses(Coupon $coupon): int
{
$count = 0;
$purchases = $this->getPurchases();
foreach($purchases as $purchase) {
$p_coupons = $purchase->getCoupons();
if($p_coupons && $p_coupons->contains($coupon)) {
$count++;
}
}
return $count;
}
/*
public function isEqualTo (UserInterface $user)
{
if ($this->password !== $user->getPassword()) {
return false;
}
if ($this->salt !== $user->getSalt()) {
return false;
}
if ($this->username !== $user->getUsername()) {
return false;
}
return true;
}
*/
/**
* @return Collection|Comment[]
*/
public function getComments(): Collection
{
return $this->comments;
}
public function addComment(Comment $comment): self
{
if (!$this->comments->contains($comment)) {
$this->comments[] = $comment;
$comment->setUser($this);
}
return $this;
}
public function removeComment(Comment $comment): self
{
if ($this->comments->contains($comment)) {
$this->comments->removeElement($comment);
// set the owning side to null (unless already changed)
if ($comment->getUser() === $this) {
$comment->setUser(null);
}
}
return $this;
}
/**
* @return Collection|Traffic[]
*/
public function getTraffic(): Collection
{
return $this->traffic;
}
public function addTraffic(Traffic $traffic): self
{
if (!$this->traffic->contains($traffic)) {
$this->traffic[] = $traffic;
$traffic->setUser($this);
}
return $this;
}
public function removeTraffic(Traffic $traffic): self
{
if ($this->traffic->contains($traffic)) {
$this->traffic->removeElement($traffic);
// set the owning side to null (unless already changed)
if ($traffic->getUser() === $this) {
$traffic->setUser(null);
}
}
return $this;
}
public function getContact(): ?Contact
{
return $this->contact;
}
public function setContact(?Contact $contact = null): self
{
$this->contact = $contact;
return $this;
}
/**
* @return Collection|PollResponse[]
*/
public function getPollResponses(): Collection
{
return $this->pollResponses;
}
public function addPollResponse(PollResponse $pollResponse): self
{
if (!$this->pollResponses->contains($pollResponse)) {
$this->pollResponses[] = $pollResponse;
$pollResponse->setUser($this);
}
return $this;
}
public function removePollResponse(PollResponse $pollResponse): self
{
if ($this->pollResponses->contains($pollResponse)) {
$this->pollResponses->removeElement($pollResponse);
// set the owning side to null (unless already changed)
if ($pollResponse->getUser() === $this) {
$pollResponse->setUser(null);
}
}
return $this;
}
public function getSiteSignedUpOn(): ?int
{
return $this->site_signed_up_on;
}
public function setSiteSignedUpOn(int $site_signed_up_on): self
{
$this->site_signed_up_on = $site_signed_up_on;
return $this;
}
public function getAuthorBio(): string
{
return $this->author_bio;
}
public function setAuthorBio(string $author_bio = null): self
{
if (is_null($author_bio)) {
$author_bio = "";
}
$this->author_bio = $author_bio;
return $this;
}
}