<?php
namespace CoreBundle\Entity;
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="CoreBundle\Entity\WordoptionIconRepository")
*/
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;
}
/**
* @param string $abbreviation
* @return void
*/
public function setAbbreviation(string $abbreviation)
{
$this->abbreviation = $abbreviation;
}
/**
* @return string
*/
public function getAbbreviation(): string
{
return $this->abbreviation;
}
/**
* @return string
*/
public function getIcon(): string
{
return $this->icon;
}
/**
* @param string $icon
* @return void
*/
public function setIcon(string $icon): void
{
$this->icon = $icon;
}
/**
* @return string
*/
public function getDescription(): string
{
return $this->description;
}
/**
* @param string $description
* @return void
*/
public function setDescription(string $description): void
{
$this->description = $description;
}
/**
* @return string
*/
public function getDisplay(): string
{
return $this->display;
}
/**
* @param string $display
* @return void
*/
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']}/bundles/abacuscore/wordoption_icons/{$this->icon}",
"description" => $this->description,
"display" => $this->display
];
}
}