<?php
namespace App\Entity;
use App\Repository\SettingRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[ORM\Entity(repositoryClass: SettingRepository::class)]
#[ORM\UniqueConstraint(name: 'unique_project_key', fields: ['project', 'key'])]
#[UniqueEntity(fields: ['project', 'key'], message: "Cette clé est déjà utilisée pour ce projet")]
class Setting
{
const KEY_WORDING_ORDER_BUTTON = 'wordingOrderButton';
const HAS_ALL_RATIOS = 'hasAllRatios';
const HAS_SHARE_BUTTON = 'hasShareButton';
const HAS_SCREEN_MODEL_EXAMPLE_SCREEN = 'hasScreenModelExampleScreen';
const HAS_STYLE_SCREEN = 'hasStyleScreen';
const HAS_ORDER_FORM_SELLER_NAME = 'hasOrderFormSellerName';
const HAS_ORDER_FORM_LOYALTY_CARD = 'hasOrderFormLoyaltyCard';
const HAS_ORDER_FORM_TERMS = 'hasOrderFormTerms';
const HAS_ORDER_FORM_COMMENT = 'hasOrderFormComment';
const HAS_ORDER_FORM_SHOW_REFERENCE = 'hasOrderFormShowReference';
const OPEN_CLIENTORDER_WITH_ORDER_POPUP = 'openClientOrderWithOrderPopup';
const EXTRA_TICKET_INFO = 'extraTicketInfo';
const BO_HAS_ORDER_BUTTON = 'boHasOrderButton';
const BO_HAS_ARCHIVE_CLIENTORDER_BUTTON = 'boHasArchiveClientOrderButton';
const STYLE_REFERENCE_DESIGN = 'styleReferenceDesign';
const STYLE_REFERENCE_CHARME = 'styleReferenceCharme';
const STYLE_REFERENCE_COLOR = 'styleReferenceColor';
const STYLE_REFERENCE_NATURE = 'styleReferenceNature';
const CONFIRMATION_REDIRECT_URL = 'confirmationRedirectUrl';
const PRIVACY_POLICY_URL = 'privacyPolicyUrl';
const TERMS_OF_SALE_URL = 'termsOfSaleUrl';
const HAS_ORDER_FORM_COMPANY = 'hasOrderFormCompany';
const HAS_ORDER_FORM_ADDRESS = 'hasOrderFormAddress';
const HAS_ORDER_FORM_ADDRESS2 = 'hasOrderFormAddress2';
const HAS_ORDER_FORM_POSTAL_CODE = 'hasOrderFormPostalCode';
const HAS_ORDER_FORM_TOWN = 'hasOrderFormTown';
const HAS_ORDER_FORM_COUNTRY = 'hasOrderFormCountry';
const HAS_MIN_LINEAR_METER = 'hasMinLinearMeter';
const HAS_ROUND_LINEAR_METER = 'hasRoundLinearMeter';
const PROJECT_SETTINGS_DEFAULTS = [
self::KEY_WORDING_ORDER_BUTTON => "Commander",
self::HAS_ALL_RATIOS => "true",
self::HAS_SCREEN_MODEL_EXAMPLE_SCREEN => "true",
self::HAS_STYLE_SCREEN => "true",
self::HAS_ORDER_FORM_SELLER_NAME => "true",
self::HAS_ORDER_FORM_LOYALTY_CARD => "false",
self::HAS_ORDER_FORM_TERMS => "false",
self::HAS_ORDER_FORM_COMMENT => "true",
self::HAS_ORDER_FORM_SHOW_REFERENCE => "false",
self::OPEN_CLIENTORDER_WITH_ORDER_POPUP => "false",
self::HAS_SHARE_BUTTON => "false",
self::EXTRA_TICKET_INFO => false,
self::BO_HAS_ORDER_BUTTON => "false",
self::BO_HAS_ARCHIVE_CLIENTORDER_BUTTON => "true",
self::STYLE_REFERENCE_DESIGN => "16203",
self::STYLE_REFERENCE_CHARME => "94451",
self::STYLE_REFERENCE_COLOR => "20962",
self::STYLE_REFERENCE_NATURE => "06400",
self::CONFIRMATION_REDIRECT_URL => null,
self::PRIVACY_POLICY_URL => "",
self::TERMS_OF_SALE_URL => "",
self::HAS_ORDER_FORM_COMPANY => "true",
self::HAS_ORDER_FORM_ADDRESS => "true",
self::HAS_ORDER_FORM_ADDRESS2 => "true",
self::HAS_ORDER_FORM_POSTAL_CODE => "true",
self::HAS_ORDER_FORM_TOWN => "true",
self::HAS_ORDER_FORM_COUNTRY => "true",
self::HAS_MIN_LINEAR_METER => "false",
self::HAS_ROUND_LINEAR_METER => "false",
];
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne]
private ?Project $project = null;
#[ORM\Column(name: 'setting_key', length: 255)]
private ?string $key = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $value = null;
public function getId(): ?int
{
return $this->id;
}
public function getProject(): ?Project
{
return $this->project;
}
public function setProject(?Project $project): static
{
$this->project = $project;
return $this;
}
public function getKey(): ?string
{
return $this->key;
}
public function setKey(string $key): static
{
$this->key = $key;
return $this;
}
public function getValue(): ?string
{
return $this->value;
}
public function setValue(?string $value): static
{
$this->value = $value;
return $this;
}
}