src_legacy/Tionvel/WorkflowBundle/Entity/WorkflowUnitRole.php line 11

Open in your IDE?
  1. <?php
  2. namespace Tionvel\WorkflowBundle\Entity;
  3. use App\Entity\User;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Entity()
  7. */
  8. class WorkflowUnitRole
  9. {
  10. /**
  11. * @var int
  12. * @ORM\Id @ORM\Column(type="integer")
  13. * @ORM\GeneratedValue(strategy="AUTO")
  14. */
  15. private $id;
  16. /**
  17. * @var WorkflowUnitWorkflow
  18. * @ORM\ManyToOne(
  19. * targetEntity="Tionvel\WorkflowBundle\Entity\WorkflowUnitWorkflow",
  20. * inversedBy="roles"
  21. * )
  22. * @ORM\JoinColumn(
  23. * onDelete="CASCADE"
  24. * )
  25. */
  26. private $unitWorkflow;
  27. /**
  28. * @var string
  29. * @ORM\Column(type="string")
  30. */
  31. private $role;
  32. /**
  33. * @var User
  34. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  35. * @ORM\JoinColumn(nullable=true, onDelete="CASCADE")
  36. */
  37. private $user;
  38. public static function create($role)
  39. {
  40. $self = new self;
  41. $self->setRole($role);
  42. return $self;
  43. }
  44. public function getId(): int
  45. {
  46. return $this->id;
  47. }
  48. public function getUnitWorkflow(): WorkflowUnitWorkflow
  49. {
  50. return $this->unitWorkflow;
  51. }
  52. public function setUnitWorkflow(WorkflowUnitWorkflow $unitWorkflow)
  53. {
  54. $this->unitWorkflow = $unitWorkflow;
  55. }
  56. public function getRole(): string
  57. {
  58. return $this->role;
  59. }
  60. public function setRole(string $role)
  61. {
  62. $this->role = $role;
  63. }
  64. public function getUser()
  65. {
  66. return $this->user;
  67. }
  68. public function setUser($user)
  69. {
  70. $this->user = $user;
  71. }
  72. }