Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * @ORM\Entity
- * @ORM\Table(name="xxxx_roles")
- */
- class Role implements RoleInterface
- {
- /**
- * @ORM\Id
- * @ORM\Column(type="integer")
- * @ORM\GeneratedValue(strategy="AUTO")
- */
- protected $id;
- /**
- * @ORM\Column(type="string", length="255", unique=true, nullable=false)
- * @Assert\NotBlank(message="Please enter your Group.")
- * @Assert\MinLength(limit="3", message="The name is too short.")
- * @Assert\MaxLength(limit="255", message="The name is too long.")
- */
- protected $role;
- /**
- * Inverse Side
- *
- * @ORM\ManyToMany(targetEntity="Group", mappedBy="roles")
- */
- protected $groups;
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Populate the role field
- * @param string $role ROLE_FOO etc
- */
- public function __construct( $role )
- {
- $this->role = $role;
- }
- /**
- * Return the role field.
- * @return string
- */
- public function getRole()
- {
- return $this->role;
- }
- /**
- * Return the role field.
- * @return string
- */
- public function __toString()
- {
- return (string) $this->role;
- }
- /**
- * Add groups
- *
- * @param xxxxx\UserBundle\Entity\Groups $groups
- */
- public function addGroups(\xxxxx\UserBundle\Entity\Groups $groups)
- {
- $this->groups[] = $groups;
- }
- /**
- * Get groups
- *
- * @return Doctrine\Common\Collections\Collection
- */
- public function getGroups()
- {
- return $this->groups;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment