Action.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <?php
  2. namespace WorkflowBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * @ORM\Table
  6. * @ORM\Entity
  7. */
  8. class Action
  9. {
  10. /**
  11. * @var int
  12. *
  13. * @ORM\Column(type="integer")
  14. * @ORM\Id
  15. * @ORM\GeneratedValue(strategy="AUTO")
  16. */
  17. private $id;
  18. /**
  19. * @var string
  20. *
  21. * @ORM\Column(type="string", length=255, nullable=false)
  22. */
  23. protected $name;
  24. /**
  25. * @var string
  26. *
  27. * @ORM\Column(type="string", length=255, nullable=false)
  28. */
  29. protected $workflowName;
  30. /**
  31. * @var string
  32. *
  33. * @ORM\Column(type="string", length=255, nullable=false)
  34. */
  35. protected $objectClass;
  36. /**
  37. * @var string
  38. *
  39. * @ORM\Column(type="string", length=255, nullable=false)
  40. */
  41. protected $event;
  42. /**
  43. * @var string
  44. *
  45. * @ORM\Column(type="string", length=255, nullable=false)
  46. */
  47. protected $eventName;
  48. /**
  49. * @var text
  50. *
  51. * @ORM\Column(type="text", nullable=false)
  52. */
  53. protected $template;
  54. /**
  55. * @var Doctrine2WorkFlowAction
  56. *
  57. * @ORM\ManyToMany(targetEntity="Doctrine2WorkFlowAction", inversedBy="actions", fetch="EXTRA_LAZY")
  58. */
  59. private $doctrine2WorkFlowActions;
  60. /**
  61. * @var int
  62. *
  63. * @ORM\Column(type="integer", nullable=false, options={"default":1})
  64. */
  65. protected $tenancyId = 1;
  66. /**
  67. * @return string
  68. */
  69. public function __toString()
  70. {
  71. return (string) $this->name;
  72. }
  73. /**
  74. * @return int
  75. */
  76. public function getId()
  77. {
  78. return $this->id;
  79. }
  80. /**
  81. * @param string $name
  82. *
  83. * @return Action
  84. */
  85. public function setName($name)
  86. {
  87. $this->name = $name;
  88. return $this;
  89. }
  90. /**
  91. * @return string
  92. */
  93. public function getName()
  94. {
  95. return $this->name;
  96. }
  97. /**
  98. * @param string $event
  99. *
  100. * @return Action
  101. */
  102. public function setEvent($event)
  103. {
  104. $this->event = $event;
  105. return $this;
  106. }
  107. /**
  108. * @return string
  109. */
  110. public function getEvent()
  111. {
  112. return $this->event;
  113. }
  114. /**
  115. * @param text $template
  116. *
  117. * @return Action
  118. */
  119. public function setTemplate($template)
  120. {
  121. $this->template = $template;
  122. return $this;
  123. }
  124. /**
  125. * @return text
  126. */
  127. public function getTemplate()
  128. {
  129. return $this->template;
  130. }
  131. /**
  132. * Set workflowName
  133. *
  134. * @param string $workflowName
  135. *
  136. * @return Action
  137. */
  138. public function setWorkflowName($workflowName)
  139. {
  140. $this->workflowName = $workflowName;
  141. return $this;
  142. }
  143. /**
  144. * Get workflowName
  145. *
  146. * @return string
  147. */
  148. public function getWorkflowName()
  149. {
  150. return $this->workflowName;
  151. }
  152. /**
  153. * Set objectClass
  154. *
  155. * @param string $objectClass
  156. *
  157. * @return Action
  158. */
  159. public function setObjectClass($objectClass)
  160. {
  161. $this->objectClass = $objectClass;
  162. return $this;
  163. }
  164. /**
  165. * Get objectClass
  166. *
  167. * @return string
  168. */
  169. public function getObjectClass()
  170. {
  171. return $this->objectClass;
  172. }
  173. /**
  174. * Set eventName
  175. *
  176. * @param string $eventName
  177. *
  178. * @return Action
  179. */
  180. public function setEventName($eventName)
  181. {
  182. $this->eventName = $eventName;
  183. return $this;
  184. }
  185. /**
  186. * Get eventName
  187. *
  188. * @return string
  189. */
  190. public function getEventName()
  191. {
  192. return $this->eventName;
  193. }
  194. /**
  195. * @return Doctrine2WorkFlowAction
  196. */
  197. public function getDoctrine2WorkFlowActions()
  198. {
  199. return $this->doctrine2WorkFlowActions;
  200. }
  201. /**
  202. * @param Doctrine2WorkFlowAction $doctrine2WorkFlowAction
  203. *
  204. * @return Workflow
  205. */
  206. public function addDoctrine2WorkFlowAction($doctrine2WorkFlowAction)
  207. {
  208. $this->doctrine2WorkFlowActions[] = $doctrine2WorkFlowAction;
  209. return $this;
  210. }
  211. /**
  212. * @param Doctrine2WorkFlowAction $doctrine2WorkFlowAction
  213. *
  214. * @return Workflow
  215. */
  216. public function removeDoctrine2WorkFlowAction($doctrine2WorkFlowAction)
  217. {
  218. $this->doctrine2WorkFlowActions->removeElement($doctrine2WorkFlowAction);
  219. return $this;
  220. }
  221. /**
  222. * Set tenancyId
  223. *
  224. * @param integer $tenancyId
  225. *
  226. * @return Action
  227. */
  228. public function setTenancyId($tenancyId)
  229. {
  230. $this->tenancyId = $tenancyId;
  231. return $this;
  232. }
  233. /**
  234. * Get tenancyId
  235. *
  236. * @return integer
  237. */
  238. public function getTenancyId()
  239. {
  240. return $this->tenancyId;
  241. }
  242. }