Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace RedK\Core\IndexBundle\Entity;
- use Doctrine\ORM\Mapping as ORM;
- use Doctrine\Common\Collections\ArrayCollection;
- use Symfony\Component\Security\Core\Role\RoleInterface;
- /**
- * RedK\Core\IndexBundle\Entity\EngineRoles
- *
- * @ORM\Table(name="engine_roles")
- * @ORM\Entity
- */
- class EngineRoles implements RoleInterface
- {
- /**
- * @var integer $id
- *
- * @ORM\Column(name="id", type="integer", nullable=false)
- * @ORM\Id
- * @ORM\GeneratedValue(strategy="IDENTITY")
- */
- protected $id;
- /**
- * @var string $role
- *
- * @ORM\Column(name="role", type="string", length=255, nullable=false, unique=true)
- */
- protected $role;
- /**
- * @ORM\ManyToMany(targetEntity="Accounts", mappedBy="roles")
- * @ORM\JoinTable(name="accounts_groups",
- * joinColumns={@ORM\JoinColumn(name="account_fk", referencedColumnName="id")},
- * inverseJoinColumns={@ORM\JoinColumn(name="role_fk", referencedColumnName="role")}
- * )
- */
- protected $accounts;
- public function __construct()
- {
- $this->accounts = new ArrayCollection();
- }
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set role
- *
- * @param string $role
- * @return EngineRoles
- */
- public function setRole($role)
- {
- $this->role = $role;
- return $this;
- }
- /**
- * Get role
- * @see RoleInterface
- * @return string
- */
- public function getRole()
- {
- return $this->role;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement