<?php/** * Copyright (c) 2019, MND Next GmbH - www.mndnext.de */namespace App\Entity\WinWOP;use App\Entity\Machine;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\HttpFoundation\File\File;use Vich\UploaderBundle\Mapping\Annotation as Vich;use Symfony\Component\Validator\Constraints as Assert;/** * @ORM\Entity * @ORM\HasLifecycleCallbacks() * @ORM\Table(name="win_wop_smc_requests") * @Vich\Uploadable */class SmcRequest{ /** * @ORM\Id * @ORM\Column(type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ protected $id; /** * @ORM\OneToOne(targetEntity="App\Entity\Machine", inversedBy="smc_request", cascade={"persist"}) */ private $machine; /** * @var \DateTime * * @ORM\Column(name="created", type="datetime", nullable=false) */ private $created; /** * @var string * * @ORM\Column(name="comment") */ private $comment; /** * Constructor */ public function __construct() { $this->created = new \DateTime(); } public function getId() { return $this->id; } public function setCreated($created) { $this->created = $created; return $this; } public function getCreated() { return $this->created; } public function setMachine(Machine $machine = null) { $this->machine = $machine; return $this; } public function getMachine() : ?Machine { return $this->machine; } public function setComment($comment) { $this->comment = $comment; return $this; } public function getComment() { return $this->comment; } public function __toString() { return $this->getMachine()->getSerial(); }}