<?php
namespace App\Entity\Core;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use JsonSerializable;
#[ORM\Table(name: 'wordoption_icons')]
#[ORM\Entity(repositoryClass: WordoptionIconRepository::class)]
class WordoptionIcon implements JsonSerializable
{
/**
* @var int
*/
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private $id;
/**
* @var string
*/
#[ORM\Column(name: 'abbreviation', type: 'string', length: 255, unique: true)]
private $abbreviation;
/**
* @var string
*/
#[ORM\Column(name: 'icon', type: 'string', length: 255, nullable: true)]
private $icon;
/**
* @var string
*/
#[ORM\Column(name: 'description', type: 'string', length: 255, nullable: true)]
private $description;
/**
* @var string
*/
#[ORM\Column(name: 'display', type: 'string', length: 255, options: ['default' => 'both'])]
private $display;
public function getId(): int
{
return $this->id;
}
/**
* @return void
*/
public function setAbbreviation(string $abbreviation)
{
$this->abbreviation = $abbreviation;
}
public function getAbbreviation(): string
{
return $this->abbreviation;
}
public function getIcon(): string
{
return $this->icon;
}
public function setIcon(string $icon): void
{
$this->icon = $icon;
}
public function getDescription(): string
{
return $this->description;
}
public function setDescription(string $description): void
{
$this->description = $description;
}
public function getDisplay(): string
{
return $this->display;
}
public function setDisplay(string $display): void
{
$this->display = $display;
}
public function jsonSerialize(): mixed
{
return [
"id" => $this->id,
"abbreviation" => $this->abbreviation,
"icon" => "http://{$_SERVER['HTTP_HOST']}/assets/wordoption_icons/core/{$this->icon}",
"description" => $this->description,
"display" => $this->display
];
}
}