123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- <?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 $eventName;
- /**
- * @var string
- *
- * @ORM\Column(type="string", length=255)
- */
- protected $entityClass;
-
- /**
- * @var ArrayCollection
- *
- * @ORM\ManyToMany(targetEntity="Action", mappedBy="doctrine2WorkFlowActions", cascade={"persist"})
- */
- protected $actions;
-
- /**
- * @return string
- */
- public function __toString()
- {
- return (string) $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 getEventName()
- {
- return $this->eventName;
- }
- /**
- * @param string $eventName
- *
- * @return $this
- */
- public function setEventName($eventName)
- {
- $this->eventName = $eventName;
- return $this;
- }
-
- /**
- * @return string
- */
- public function getEntityClass()
- {
- return $this->entityClass;
- }
- /**
- * @param string $entityClass
- *
- * @return $this
- */
- public function setEntityClass($entityClass)
- {
- $this->entityClass = $entityClass;
-
- 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;
- }
- }
|