<?php
namespace App\Entity\Slave;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table(name="eposm_s_account_category")
* @ORM\Entity
*/
class AccountCategory
{
public function __toString(){
return $this->getValue();
}
/**
* @ORM\Column(name="id", type="bigint")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(name="value", type="string", length=191)
*/
protected $value;
/**
* @ORM\Column(name="slug", type="string", length=191)
*/
protected $slug;
// OneToMany
/**
* @ORM\OneToMany(targetEntity="App\Entity\Slave\AccountType", mappedBy="category")
*/
private $types;
public function __construct()
{
$this->types = new ArrayCollection();
}
//
public function getId(): ?string
{
return $this->id;
}
public function getValue(): ?string
{
return $this->value;
}
public function setValue(string $value): self
{
$this->value = $value;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): self
{
$this->slug = $slug;
return $this;
}
/**
* @return Collection<int, AccountType>
*/
public function getTypes(): Collection
{
return $this->types;
}
public function addType(AccountType $type): self
{
if (!$this->types->contains($type)) {
$this->types->add($type);
$type->setCategory($this);
}
return $this;
}
public function removeType(AccountType $type): self
{
if ($this->types->removeElement($type)) {
// set the owning side to null (unless already changed)
if ($type->getCategory() === $this) {
$type->setCategory(null);
}
}
return $this;
}
}