shuba_ivan

code

Nov 11th, 2015
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. class CodeDirectorySpecialities
  2. {
  3. use Timestampable;
  4. /**
  5. * @var integer
  6. *
  7. * @ORM\Column(name="id", type="integer")
  8. * @ORM\Id
  9. * @ORM\GeneratedValue(strategy="AUTO")
  10. */
  11. private $id;
  12.  
  13. /**
  14. * @var string
  15. *
  16. * @ORM\Column(name="specialities", type="string", length=255)
  17. */
  18. private $specialities;
  19.  
  20. /**
  21. * @ORM\ManyToMany(targetEntity="Artel\ProfileBundle\Entity\Skill", mappedBy="specialities", cascade={"persist"})
  22. */
  23. protected $skills;
  24.  
  25. /**
  26. * Constructor
  27. */
  28. public function __construct()
  29. {
  30. $this->skills = new \Doctrine\Common\Collections\ArrayCollection();
  31. }
  32.  
  33. /**
  34. * Get id
  35. *
  36. * @return integer
  37. */
  38. public function setId($id)
  39. {
  40. $this->id = $id;
  41.  
  42. return $this;
  43. }
  44.  
  45. /**
  46. * Get id
  47. *
  48. * @return integer
  49. */
  50. public function getId()
  51. {
  52. return $this->id;
  53. }
  54.  
  55. /**
  56. * Set specialities
  57. *
  58. * @param string $specialities
  59. *
  60. * @return CodeDirectorySpecialities
  61. */
  62. public function setSpecialities($specialities)
  63. {
  64. $this->specialities = $specialities;
  65.  
  66. return $this;
  67. }
  68.  
  69. /**
  70. * Get specialities
  71. *
  72. * @return string
  73. */
  74. public function getSpecialities()
  75. {
  76. return $this->specialities;
  77. }
  78.  
  79. /**
  80. * Add skill
  81. *
  82. * @param \Artel\ProfileBundle\Entity\Skill $skill
  83. *
  84. * @return CodeDirectorySpecialities
  85. */
  86. public function addSkill(\Artel\ProfileBundle\Entity\Skill $skill)
  87. {
  88. $this->skills[] = $skill;
  89.  
  90. return $this;
  91. }
  92.  
  93. /**
  94. * Remove skill
  95. *
  96. * @param \Artel\ProfileBundle\Entity\Skill $skill
  97. */
  98. public function removeSkill(\Artel\ProfileBundle\Entity\Skill $skill)
  99. {
  100. $this->skills->removeElement($skill);
  101. }
  102.  
  103. /**
  104. * Get skills
  105. *
  106. * @return \Doctrine\Common\Collections\Collection
  107. */
  108. public function getSkills()
  109. {
  110. return $this->skills;
  111. }
  112.  
  113. public function __toString()
  114. {
  115. return $this->specialities;
  116. }
  117. }
Advertisement
Add Comment
Please, Sign In to add comment