Skip to content

Instantly share code, notes, and snippets.

@aelamel
Created January 27, 2019 14:34
Show Gist options
  • Save aelamel/16d40dd89c43e9429202720d711c2677 to your computer and use it in GitHub Desktop.
Save aelamel/16d40dd89c43e9429202720d711c2677 to your computer and use it in GitHub Desktop.
<?php
namespace AppBundle\Entity;
use Symfony\Component\HttpFoundation\File\File as File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation as Serializer;
use Symfony\Component\Validator\Constraints as Assert;
/**
* ReleaseNotes
*
* @ORM\Table(name="release_notes")
* @ORM\Entity(repositoryClass="AppBundle\Repository\ReleaseNotesRepository")
* @Vich\Uploadable
*/
class ReleaseNotes
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, name="version", nullable=true)
*
* @var string $version
*/
private $version;
/**
* @ORM\Column(type="string", length=255, name="document", nullable=true)
*
* @var string $document
*/
private $document;
/**
* @var string
*
* @ORM\Column(name="message", type="text")
*/
private $message;
/**
* @var \DateTime
* Release date
* @ORM\Column(type="datetime", name="release_date", nullable=true)
*/
private $releaseDate;
/**
* @Assert\File(
* mimeTypes={
* "application/pdf",
* "image/jpeg",
* "image/pjpeg",
* "application/msword",
* "image/png"
* },
* mimeTypesMessage="The file format is not correct"
* )
* @Vich\UploadableField(mapping="release_note_mapping", fileNameProperty="document", nullable=true)
*
* @var File $file
* @Serializer\Exclude
*/
private $file;
public function __construct()
{
$this->releaseDate = new \DateTime();
}
/**
* @param int $id
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @return string
*/
public function getVersion()
{
return $this->version;
}
/**
* @param string $version
*/
public function setVersion($version)
{
$this->version = $version;
}
/**
* @return mixed
*/
public function getDocument()
{
return $this->document;
}
/**
* @param mixed $document
*/
public function setDocument($document)
{
$this->document = $document;
}
/**
* @return string
*/
public function getMessage()
{
return $this->message;
}
/**
* @param string $message
*/
public function setMessage($message)
{
$this->message = $message;
}
/**
* @return File
*/
public function getFile()
{
return $this->file;
}
/**
* @param File $file
*/
public function setFile($file)
{
$this->file = $file;
}
/**
* @return \DateTime
*/
public function getReleaseDate()
{
return $this->releaseDate;
}
/**
* @param \DateTime $releaseDate
*/
public function setReleaseDate($releaseDate)
{
$this->releaseDate = $releaseDate;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment