127 lines
2.3 KiB
PHP

<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\MainBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
/**
* @ORM\Entity
* @ORM\Table(name="centers")
*/
class Center implements HasCenterInterface
{
/**
* @var Collection
*
* @ORM\OneToMany(
* targetEntity="Chill\MainBundle\Entity\GroupCenter",
* mappedBy="center"
* )
*/
private $groupCenters;
/**
* @var int
*
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
* @Serializer\Groups({"docgen:read"})
*/
private string $name = '';
/**
* Center constructor.
*/
public function __construct()
{
$this->groupCenters = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* @return string
*/
public function __toString()
{
return $this->getName();
}
/**
* @return $this
*/
public function addGroupCenter(GroupCenter $groupCenter)
{
$this->groupCenters->add($groupCenter);
return $this;
}
/**
* @return $this|Center
*/
public function getCenter()
{
return $this;
}
/**
* @return ArrayCollection|Collection
*/
public function getGroupCenters()
{
return $this->groupCenters;
}
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @param $name
*
* @return $this
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
}