Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace HardCoreMore\HRAPIBundle\Entity;
- use Doctrine\ORM\Mapping as ORM;
- use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
- /**
- * Tag
- *
- * @ORM\Table(name="tags")
- * @ORM\Entity(repositoryClass="HardCoreMore\HRAPIBundle\Entity\TagRepository")
- *
- * @UniqueEntity(fields="name", message="Tag already exists")
- */
- class Tag
- {
- /**
- * @var integer
- *
- * @ORM\Column(name="id", type="integer")
- * @ORM\Id
- * @ORM\GeneratedValue(strategy="AUTO")
- */
- private $id;
- /**
- * @var string
- *
- * @ORM\Column(name="name", type="string", length=127)
- */
- private $name;
- /**
- *
- * @ORM\ManyToMany(targetEntity="HumanResource")
- * @ORM\JoinTable(name="human_resource_tags",
- * joinColumns={@ORM\JoinColumn(name="tag_id", referencedColumnName="id")},
- * inverseJoinColumns={@ORM\JoinColumn(name="human_resource_id", referencedColumnName="id")}
- * )
- */
- protected $human_resources;
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set name
- *
- * @param string $name
- * @return Tag
- */
- public function setName($name)
- {
- $this->name = $name;
- return $this;
- }
- /**
- * Get name
- *
- * @return string
- */
- public function getName()
- {
- return $this->name;
- }
- /**
- * Constructor
- */
- public function __construct()
- {
- $this->human_resources = new \Doctrine\Common\Collections\ArrayCollection();
- }
- /**
- * Add humanResources
- *
- * @param \HardCoreMore\HRAPIBundle\Entity\HumanResource $humanResources
- * @return Tag
- */
- public function addHumanResource(\HardCoreMore\HRAPIBundle\Entity\HumanResource $humanResource)
- {
- $this->human_resources[] = $humanResource;
- return $this;
- }
- /**
- * Remove humanResources
- *
- * @param \HardCoreMore\HRAPIBundle\Entity\HumanResource $humanResources
- */
- public function removeHumanResource(\HardCoreMore\HRAPIBundle\Entity\HumanResource $humanResource)
- {
- $this->human_resources->removeElement($humanResource);
- }
- /**
- * Get humanResources
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getHumanResources()
- {
- return $this->human_resources;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement