src/Entity/Action.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * Action
  6.  *
  7.  * @ORM\Table(name="pe_action")
  8.  * @ORM\Entity(repositoryClass="App\Repository\ActionRepository")
  9.  * @ORM\HasLifecycleCallbacks()
  10.  */
  11. class Action
  12. {
  13.     public const STATUS_RUNNING 'running';
  14.     public const STATUS_PENDING 'pending';
  15.     public const STATUS_ERROR   'error';
  16.     /**
  17.      * @var int
  18.      *
  19.      * @ORM\Column(name="id", type="integer")
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue(strategy="AUTO")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @var string
  26.      *
  27.      * @ORM\Column(name="command", type="string", length=255)
  28.      */
  29.     private $command;
  30.     /**
  31.      * @var string
  32.      *
  33.      * @ORM\Column(name="status", type="string", length=255)
  34.      */
  35.     private $status;
  36.     /**
  37.      * @var string
  38.      *
  39.      * @ORM\Column(name="feedback", type="text", nullable=true)
  40.      */
  41.     private $feedback;
  42.     /**
  43.      * @var array
  44.      *
  45.      * @ORM\Column(name="arguments", type="array", nullable=true)
  46.      */
  47.     private $arguments;
  48.     /**
  49.      * @var int
  50.      *
  51.      * @ORM\Column(name="priority", type="integer", nullable=true)
  52.      */
  53.     private $priority;
  54.     /**
  55.      * @var \DateTime
  56.      *
  57.      * @ORM\Column(name="createdAt", type="datetime", nullable=false)
  58.      */
  59.     protected $createdAt;
  60.     public function __construct()
  61.     {
  62.         $this->status self::STATUS_PENDING;
  63.     }
  64.     /**
  65.      * Get id
  66.      *
  67.      * @return int
  68.      */
  69.     public function getId()
  70.     {
  71.         return $this->id;
  72.     }
  73.     /**
  74.      * Set command
  75.      *
  76.      * @param string $command
  77.      *
  78.      * @return Action
  79.      */
  80.     public function setCommand($command)
  81.     {
  82.         $this->command $command;
  83.         return $this;
  84.     }
  85.     /**
  86.      * Get command
  87.      *
  88.      * @return string
  89.      */
  90.     public function getCommand()
  91.     {
  92.         return $this->command;
  93.     }
  94.     /**
  95.      * Set arguments
  96.      *
  97.      * @param array $arguments
  98.      *
  99.      * @return Action
  100.      */
  101.     public function setArguments($arguments)
  102.     {
  103.         $this->arguments $arguments;
  104.         return $this;
  105.     }
  106.     /**
  107.      * Get arguments
  108.      *
  109.      * @return array
  110.      */
  111.     public function getArguments()
  112.     {
  113.         return $this->arguments;
  114.     }
  115.     /**
  116.      * Set priority
  117.      *
  118.      * @param integer $priority
  119.      *
  120.      * @return Action
  121.      */
  122.     public function setPriority($priority)
  123.     {
  124.         $this->priority $priority;
  125.         return $this;
  126.     }
  127.     /**
  128.      * Get priority
  129.      *
  130.      * @return int
  131.      */
  132.     public function getPriority()
  133.     {
  134.         return $this->priority;
  135.     }
  136.     /**
  137.      * @return \DateTime
  138.      */
  139.     public function getCreatedAt()
  140.     {
  141.         return $this->createdAt;
  142.     }
  143.     /**
  144.      * Set createdAt
  145.      * @ORM\PrePersist
  146.      */
  147.     public function setCreatedAt()
  148.     {
  149.         $this->createdAt = new \DateTime();
  150.         return $this;
  151.     }
  152.     /**
  153.      * @return string
  154.      */
  155.     public function getStatus()
  156.     {
  157.         return $this->status;
  158.     }
  159.     /**
  160.      * @param string $status
  161.      */
  162.     public function setStatus($status)
  163.     {
  164.         $this->status $status;
  165.     }
  166.     /**
  167.      * @return string
  168.      */
  169.     public function getFeedback()
  170.     {
  171.         return $this->feedback;
  172.     }
  173.     /**
  174.      * @param string $feedback
  175.      */
  176.     public function setFeedback($feedback)
  177.     {
  178.         $this->feedback $feedback;
  179.     }
  180. }