<?php declare(strict_types=1);
namespace Sq\Entity\Schema\ORM;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table(name: 'user_settings')]
class UserSettings
{
/**
*
* @var int|null
*/
#[ORM\Id]
#[ORM\Column(name: 'us_id', type: 'integer', nullable: false, options: ['unsigned' => true])]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private $id;
/**
*
* @var User
*/
#[ORM\OneToOne(targetEntity: User::class, inversedBy: 'settings', cascade: ['persist'])]
#[ORM\JoinColumn(name: 'us_u_id', referencedColumnName: 'u_id', nullable: false)]
private $user;
/**
* @var bool
*/
#[ORM\Column(name: 'us_online_marketing', type: 'boolean', nullable: false, options: ['default' => true])]
private $onlineMarketing = true;
/**
* @var bool
*/
#[ORM\Column(name: 'us_notify_product_updates', type: 'boolean', nullable: false, options: ['default' => true])]
private $notifyProductUpdates = true;
/**
* @var bool
*/
#[ORM\Column(name: 'us_notify_mailing_list', type: 'boolean', nullable: false, options: ['default' => true])]
private $notifyMailingList = true;
/**
* @var bool
*/
#[ORM\Column(name: 'us_notify_feature_added', type: 'boolean', nullable: false, options: ['default' => true])]
private $notifyFeatureAdded = true;
/**
* @var bool
*/
#[ORM\Column(name: 'us_notify_referral_credits', type: 'boolean', nullable: false, options: ['default' => true])]
private $notifyReferralCredits = true;
public function __construct(User $user)
{
$this->user = $user;
}
public function getId(): ?int
{
return $this->id;
}
public function getUser(): User
{
return $this->user;
}
public function hasOnlineMarketing(): bool
{
return $this->onlineMarketing;
}
public function setOnlineMarketing(bool $onlineMarketing): self
{
$this->onlineMarketing = $onlineMarketing;
return $this;
}
public function isNotifyProductUpdatesEnabled(): bool
{
return $this->notifyProductUpdates;
}
public function setNotifyProductUpdatesEnabled(bool $notifyProductUpdates): self
{
$this->notifyProductUpdates = $notifyProductUpdates;
return $this;
}
public function isNotifyMailingListEnabled(): bool
{
return $this->notifyMailingList;
}
public function setNotifyMailingListEnabled(bool $notifyMailingList): self
{
$this->notifyMailingList = $notifyMailingList;
return $this;
}
public function isNotifyFeatureAddedEnabled(): bool
{
return $this->notifyFeatureAdded;
}
public function setNotifyFeatureAddedEnabled(bool $notifyFeatureAdded): self
{
$this->notifyFeatureAdded = $notifyFeatureAdded;
return $this;
}
public function isNotifyReferralCreditsEnabled(): bool
{
return $this->notifyReferralCredits;
}
public function setNotifyReferralCreditsEnabled(bool $notifyReferralCredits): self
{
$this->notifyReferralCredits = $notifyReferralCredits;
return $this;
}
}