Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace S4P\MainBundle\Entity;
- use Doctrine\ORM\Mapping as ORM;
- use Gedmo\Mapping\Annotation as Gedmo;
- use Vich\UploaderBundle\Mapping\Annotation as Vich;
- use Symfony\Component\Validator\Constraints as Assert;
- /**
- * Entry
- *
- * @ORM\Table()
- * @ORM\Entity(repositoryClass="S4P\MainBundle\Entity\EntryRepository")
- * @Vich\Uploadable
- */
- class Entry {
- /**
- * @var integer
- *
- * @ORM\Column(name="id", type="integer")
- * @ORM\Id
- * @ORM\GeneratedValue(strategy="AUTO")
- */
- private $id;
- /**
- * @var string
- * @ORM\Column(name="title", type="string", length=128)
- */
- private $title;
- /**
- * @var string
- * @ORM\Column(name="text", type="text")
- */
- private $text;
- /**
- * @var string
- *
- * @ORM\Column(name="img_name", type="string", length=255)
- */
- private $img_name;
- /**
- * @Assert\File(
- * maxSize="1M",
- * mimeTypes={"image/png", "image/jpeg", "image/pjpeg"}
- * )
- * @Vich\UploadableField(mapping="s4p_article_image", fileNameProperty="img_name")
- *
- * @var File $image
- */
- private $image;
- /**
- * @var string
- * @ORM\Column(name="author", type="string", length=255)
- */
- private $author;
- /**
- * @var \DateTime
- *
- * @ORM\Column(name="pub_date", type="datetime")
- * @Gedmo\Timestampable(on="create")
- */
- private $pub_date;
- /**
- * @var
- * @ORM\ManyToOne(targetEntity="Category", inversedBy="entries")
- * @ORM\JoinColumn(name="cat_id", referencedColumnName="id")
- */
- private $category;
- /**
- * @var string
- * @ORM\Column(length=255, unique=true)
- * @Gedmo\Slug(fields={"title"})
- */
- private $slug;
- /**
- * @param mixed $category
- */
- public function setCategory(Category $category) {
- $category->addEntry($this);
- $this->category = $category;
- }
- /**
- * @return mixed
- */
- public function getCategory() {
- return $this->category;
- }
- /**
- * Get id
- *
- * @return integer
- */
- public function getId() {
- return $this->id;
- }
- /**
- * Set $text
- *
- * @param string $text
- * @return Entry
- */
- public function setText($text) {
- $this->$text = $text;
- }
- /**
- * @param mixed $title
- */
- public function setTitle($title) {
- $this->title = $title;
- }
- /**
- * @return mixed
- */
- public function getTitle() {
- return $this->title;
- }
- /**
- * @return slug
- */
- public function getSlug() {
- return $this->slug;
- }
- /**
- * Get entText
- *
- * @return string
- */
- public function getText() {
- return $this->text;
- }
- /**
- * Set img
- *
- * @param string $img
- * @return Entry
- */
- public function setImgName($img) {
- $this->img_name = $img;
- return $this;
- }
- /**
- * Get imgLink
- *
- * @return string
- */
- public function getImgName() {
- return $this->img_name;
- }
- /**
- * Set author
- *
- * @param string $author
- * @return Entry
- */
- public function setAuthor($author) {
- $this->author = $author;
- return $this;
- }
- /**
- * Get author
- *
- * @return string
- */
- public function getAuthor() {
- return $this->author;
- }
- /**
- * Set pubDate
- *
- * @param \DateTime $pub_date
- * @return Entry
- */
- public function setPubDate($pub_date) {
- $this->pub_date = $pub_date;
- return $this;
- }
- /**
- * Get pubDate
- *
- * @return \DateTime
- */
- public function getPubDate() {
- return $this->pub_date;
- }
- /**
- * Set slug
- *
- * @param string $slug
- * @return Entry
- */
- public function setSlug($slug) {
- $this->slug = $slug;
- return $this;
- }
- /**
- * @param $image
- */
- public function setImage($image) {
- $this->image = $image;
- }
- /**
- * @return image
- */
- public function getImage() {
- return $this->image;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement