shuba_ivan

Untitled

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