<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation\Groups;
/**
* Class Unit
*
* @ORM\Entity(repositoryClass="App\Repository\UnitRepository")
* @ORM\Table(name="malys_unit")
* @ORM\HasLifecycleCallbacks()
* @package App\Entity
*/
class Unit
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @Groups({"api"})
*/
protected $id;
/**
* @var string
*
* @ORM\Column(name="singular_label", type="string", length=255, nullable=false)
* @Groups({"api"})
*/
protected $singularLabel;
/**
* @var string
*
* @ORM\Column(name="plural_label", type="string", length=255, nullable=false)
*/
protected $pluralLabel;
/**
* @var string
*
* @ORM\Column(name="sub_unit_short_label", type="string", length=255, nullable=true)
*/
protected $subUnitShortLabel;
/**
* @var float
*
* @ORM\Column(name="sub_unit_count", type="float", nullable=true)
*/
private $subUnitCount;
public function __toString()
{
return $this->getSingularLabel();
}
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @param int $id
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return string
*/
public function getSingularLabel()
{
return $this->singularLabel;
}
public function getLabel()
{
return ucfirst($this->getSingularLabel());
}
/**
* @param string $singularLabel
*/
public function setSingularLabel($singularLabel)
{
$this->singularLabel = $singularLabel;
}
/**
* @return string
*/
public function getPluralLabel()
{
return $this->pluralLabel;
}
/**
* @param string $pluralLabel
*/
public function setPluralLabel($pluralLabel)
{
$this->pluralLabel = $pluralLabel;
}
/**
* @return string
*/
public function getSubUnitShortLabel()
{
return $this->subUnitShortLabel;
}
/**
* @param string $subUnitShortLabel
*/
public function setSubUnitShortLabel($subUnitShortLabel)
{
$this->subUnitShortLabel = $subUnitShortLabel;
}
/**
* @return float
*/
public function getSubUnitCount()
{
return $this->subUnitCount;
}
/**
* @param float $subUnitCount
*/
public function setSubUnitCount($subUnitCount)
{
$this->subUnitCount = $subUnitCount;
}
}