|
@@ -0,0 +1,170 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace WorkflowBundle\Entity;
|
|
|
+
|
|
|
+use Doctrine\Common\Collections\ArrayCollection;
|
|
|
+use Doctrine\ORM\Mapping as ORM;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @ORM\Table
|
|
|
+ * @ORM\Entity(repositoryClass="WorkflowBundle\Repository\Doctrine2WorkFlowActionRepository")
|
|
|
+ */
|
|
|
+class Doctrine2WorkFlowAction
|
|
|
+{
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var int
|
|
|
+ *
|
|
|
+ * @ORM\Column(name="id", type="integer")
|
|
|
+ * @ORM\Id
|
|
|
+ * @ORM\GeneratedValue(strategy="AUTO")
|
|
|
+ */
|
|
|
+ private $id;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var string
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="string", length=255)
|
|
|
+ */
|
|
|
+ private $name;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var string
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="string", length=255)
|
|
|
+ */
|
|
|
+ protected $event;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var string
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="string", length=255)
|
|
|
+ */
|
|
|
+ protected $entity;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var ArrayCollection
|
|
|
+ *
|
|
|
+ * @ORM\ManyToMany(targetEntity="Action", mappedBy="doctrine2WorkFlowActions", cascade={"persist"})
|
|
|
+ */
|
|
|
+ protected $actions;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function __toString()
|
|
|
+ {
|
|
|
+ return $this->name;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function __construct()
|
|
|
+ {
|
|
|
+ $this->actions = new ArrayCollection();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get id
|
|
|
+ *
|
|
|
+ * @return int
|
|
|
+ */
|
|
|
+ public function getId()
|
|
|
+ {
|
|
|
+ return $this->id;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getName()
|
|
|
+ {
|
|
|
+ return $this->name;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string $name
|
|
|
+ *
|
|
|
+ * @return $this
|
|
|
+ */
|
|
|
+ public function setName($name)
|
|
|
+ {
|
|
|
+ $this->name = $name;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getEvent()
|
|
|
+ {
|
|
|
+ return $this->event;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string $event
|
|
|
+ *
|
|
|
+ * @return $this
|
|
|
+ */
|
|
|
+ public function setEvent($event)
|
|
|
+ {
|
|
|
+ $this->event = $event;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getEntity()
|
|
|
+ {
|
|
|
+ return $this->entity;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string $entity
|
|
|
+ *
|
|
|
+ * @return $this
|
|
|
+ */
|
|
|
+ public function setEntity($entity)
|
|
|
+ {
|
|
|
+ $this->entity = $entity;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param Action $action
|
|
|
+ *
|
|
|
+ * @return Workflow
|
|
|
+ */
|
|
|
+ public function addAction($action)
|
|
|
+ {
|
|
|
+ $action->addDoctrine2WorkFlowAction($this);
|
|
|
+ $this->actions[] = $action;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param Action $action
|
|
|
+ *
|
|
|
+ * @return Workflow
|
|
|
+ */
|
|
|
+ public function removeAction($action)
|
|
|
+ {
|
|
|
+ $action->removeDoctrine2WorkFlowAction($this);
|
|
|
+ $this->actions->removeElement($action);
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return ArrayCollection
|
|
|
+ */
|
|
|
+ public function getActions()
|
|
|
+ {
|
|
|
+ return $this->actions;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|