Action.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  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 $workflowType;
  30. /**
  31. * @var string
  32. *
  33. * @ORM\Column(type="string", length=255, nullable=false)
  34. */
  35. protected $workflowName;
  36. /**
  37. * @var string
  38. *
  39. * @ORM\Column(type="string", length=255, nullable=false)
  40. */
  41. protected $objectClass;
  42. /**
  43. * @var string
  44. *
  45. * @ORM\Column(type="string", length=255, nullable=false)
  46. */
  47. protected $event;
  48. /**
  49. * @var string
  50. *
  51. * @ORM\Column(type="string", length=255, nullable=false)
  52. */
  53. protected $eventReference;
  54. /**
  55. * @var text
  56. *
  57. * @ORM\Column(type="text", nullable=false)
  58. */
  59. protected $template;
  60. /**
  61. * @var Doctrine2WorkFlowAction
  62. *
  63. * @ORM\ManyToMany(targetEntity="Doctrine2WorkFlowAction", inversedBy="actions", fetch="EXTRA_LAZY")
  64. */
  65. private $doctrine2WorkFlowActions;
  66. /**
  67. * @var int
  68. *
  69. * @ORM\Column(type="integer", nullable=false, options={"default":1})
  70. */
  71. protected $tenancyId = 1;
  72. /**
  73. * @return string
  74. */
  75. public function __toString()
  76. {
  77. return (string) $this->name;
  78. }
  79. /**
  80. * @return int
  81. */
  82. public function getId()
  83. {
  84. return $this->id;
  85. }
  86. /**
  87. * @param string $name
  88. *
  89. * @return Action
  90. */
  91. public function setName($name)
  92. {
  93. $this->name = $name;
  94. return $this;
  95. }
  96. /**
  97. * @return string
  98. */
  99. public function getName()
  100. {
  101. return $this->name;
  102. }
  103. /**
  104. * @param string $event
  105. *
  106. * @return Action
  107. */
  108. public function setEvent($event)
  109. {
  110. $this->event = $event;
  111. return $this;
  112. }
  113. /**
  114. * @return string
  115. */
  116. public function getEvent()
  117. {
  118. return $this->event;
  119. }
  120. /**
  121. * @param text $template
  122. *
  123. * @return Action
  124. */
  125. public function setTemplate($template)
  126. {
  127. $this->template = $template;
  128. return $this;
  129. }
  130. /**
  131. * @return text
  132. */
  133. public function getTemplate()
  134. {
  135. return $this->template;
  136. }
  137. /**
  138. * Set workflowType
  139. *
  140. * @param string $workflowType
  141. *
  142. * @return Action
  143. */
  144. public function setWorkflowType($workflowType)
  145. {
  146. $this->workflowType = $workflowType;
  147. return $this;
  148. }
  149. /**
  150. * Get workflowType
  151. *
  152. * @return string
  153. */
  154. public function getWorkflowType()
  155. {
  156. return $this->workflowType;
  157. }
  158. /**
  159. * Set workflowName
  160. *
  161. * @param string $workflowName
  162. *
  163. * @return Action
  164. */
  165. public function setWorkflowName($workflowName)
  166. {
  167. $this->workflowName = $workflowName;
  168. return $this;
  169. }
  170. /**
  171. * Get workflowName
  172. *
  173. * @return string
  174. */
  175. public function getWorkflowName()
  176. {
  177. return $this->workflowName;
  178. }
  179. /**
  180. * Set objectClass
  181. *
  182. * @param string $objectClass
  183. *
  184. * @return Action
  185. */
  186. public function setObjectClass($objectClass)
  187. {
  188. $this->objectClass = $objectClass;
  189. return $this;
  190. }
  191. /**
  192. * Get objectClass
  193. *
  194. * @return string
  195. */
  196. public function getObjectClass()
  197. {
  198. return $this->objectClass;
  199. }
  200. /**
  201. * Set eventReference
  202. *
  203. * @param string $eventReference
  204. *
  205. * @return Action
  206. */
  207. public function setEventReference($eventReference)
  208. {
  209. $this->eventReference = $eventReference;
  210. return $this;
  211. }
  212. /**
  213. * Get eventReference
  214. *
  215. * @return string
  216. */
  217. public function getEventReference()
  218. {
  219. return $this->eventReference;
  220. }
  221. /**
  222. * @return Doctrine2WorkFlowAction
  223. */
  224. public function getDoctrine2WorkFlowActions()
  225. {
  226. return $this->doctrine2WorkFlowActions;
  227. }
  228. /**
  229. * @param Doctrine2WorkFlowAction $doctrine2WorkFlowAction
  230. *
  231. * @return Workflow
  232. */
  233. public function addDoctrine2WorkFlowAction($doctrine2WorkFlowAction)
  234. {
  235. $this->doctrine2WorkFlowActions[] = $doctrine2WorkFlowAction;
  236. return $this;
  237. }
  238. /**
  239. * @param Doctrine2WorkFlowAction $doctrine2WorkFlowAction
  240. *
  241. * @return Workflow
  242. */
  243. public function removeDoctrine2WorkFlowAction($doctrine2WorkFlowAction)
  244. {
  245. $this->doctrine2WorkFlowActions->removeElement($doctrine2WorkFlowAction);
  246. return $this;
  247. }
  248. /**
  249. * Set tenancyId
  250. *
  251. * @param integer $tenancyId
  252. *
  253. * @return Action
  254. */
  255. public function setTenancyId($tenancyId)
  256. {
  257. $this->tenancyId = $tenancyId;
  258. return $this;
  259. }
  260. /**
  261. * Get tenancyId
  262. *
  263. * @return integer
  264. */
  265. public function getTenancyId()
  266. {
  267. return $this->tenancyId;
  268. }
  269. /**
  270. * @param Entity $entity
  271. *
  272. * @return string
  273. */
  274. public function getCmd($entity)
  275. {
  276. return '';
  277. }
  278. }