ascott

Entity - AccountsRoles

Jul 4th, 2012
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.97 KB | None | 0 0
  1. <?php
  2.  
  3. namespace RedK\Core\IndexBundle\Entity;
  4.  
  5. use Symfony\Component\Security\Core\Role\RoleInterface;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\ORM\Mapping as ORM;
  8.  
  9. /**
  10.  * RedK\IndexBundle\Entity\AccountsRoles
  11.  *
  12.  * @ORM\Table(name="accounts_roles")
  13.  * @ORM\Entity()
  14.  */
  15. class AccountsRoles implements RoleInterface
  16. {
  17.     /**
  18.      * @var integer $rolesID
  19.      *
  20.      * @ORM\Column(name="RolesID", type="integer", nullable=false)
  21.      * @ORM\Id()
  22.      * @ORM\GeneratedValue(strategy="AUTO")
  23.      */
  24.     private $rolesID;
  25.  
  26.     /**
  27.      * @ORM\Column(name="Name", type="string", length=225)
  28.      */
  29.     private $name;
  30.  
  31.     /**
  32.      * @ORM\Column(name="Role", type="string", length=25, unique=true)
  33.      */
  34.     private $role;
  35.  
  36.     /**
  37.      * @ORM\ManyToMany(targetEntity="Accounts", mappedBy="groups")
  38.      */
  39.     private $users;
  40.  
  41.     public function __construct()
  42.     {
  43.         $this->users = new ArrayCollection();
  44.     }
  45.  
  46.     /**
  47.      * Get rolesID
  48.      *
  49.      * @return string
  50.      */
  51.     public function getRolesID()
  52.     {
  53.         return $this->rolesID;
  54.     }
  55.  
  56.     /**
  57.      * Set role
  58.      *
  59.      * @param string $role
  60.      */
  61.     public function setRole($role)
  62.     {
  63.         $this->role = $role;
  64.     }
  65.  
  66.     /**
  67.      * @see RoleInterface
  68.      */
  69.     public function getRole()
  70.     {
  71.         return $this->role;
  72.     }
  73.  
  74.     /**
  75.      * Set name
  76.      *
  77.      * @param string $name
  78.      */
  79.     public function setName($name)
  80.     {
  81.         $this->name = $name;
  82.     }
  83.  
  84.     /**
  85.      * Get name
  86.      *
  87.      * @return string
  88.      */
  89.     public function getName()
  90.     {
  91.         return $this->name;
  92.     }
  93.  
  94.     /**
  95.      * Set users
  96.      *
  97.      * @param array $users
  98.      */
  99.     public function setUsers($users)
  100.     {
  101.         $this->users = $users;
  102.     }
  103.  
  104.     /**
  105.      * Get users
  106.      *
  107.      * @return array
  108.      */
  109.     public function getUsers()
  110.     {
  111.         return $this->users;
  112.     }
  113. }
Add Comment
Please, Sign In to add comment