<?php
namespace MobileAppApi\Entity;
use App\Entity\User;
use App\Utility\DateTimeUtility;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
use Exception;
/**
* @ORM\Entity
*
* @ORM\Table(
* name="mobile_app_user_preferences"
* )
*/
class MobileAppUserPreferences
{
/** @throws Exception */
public function __construct(User $user)
{
$this->user = $user;
$this->createdAt = DateTimeUtility::createDateTimeUtc();
$this->showForwardingToWebDialog = true;
}
/**
* @ORM\OneToOne(targetEntity="App\Entity\User", cascade={"persist"})
*
* @ORM\JoinColumn(name="users_id", referencedColumnName="id", onDelete="CASCADE")
*
* @ORM\Id
*/
private User $user;
public function getUser(): User
{
return $this->user;
}
/**
* @ORM\Column(name="created_at", type="datetime", nullable=false)
*/
private DateTime $createdAt;
/**
* @ORM\Column(name="show_forwarding_to_web_dialog", type="boolean", nullable=false)
*/
private bool $showForwardingToWebDialog;
public function setShowForwardingToWebDialog(bool $showForwardingToWebDialog): void
{
$this->showForwardingToWebDialog = $showForwardingToWebDialog;
}
public function showForwardingToWebDialog(): bool
{
return $this->showForwardingToWebDialog;
}
}