<?php

namespace AppBundle\Entity;

use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Table
 * @ORM\Entity
 */
class FewoLodgingImage
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="full_file_name", type="string", length=255, nullable=false)
     * @Assert\Image(maxSize="15000000", mimeTypes={"image/jpeg", "image/png"})
     */
    private $file;

    /**
     * @var string
     *
     * @ORM\Column(name="file_name", type="string", length=255, nullable=false)
     * @Assert\NotBlank
     */
    private $fileName;

     /**
     * @var string
     *
     * @ORM\Column(name="pos", type="integer", nullable=false)
     * @Assert\NotBlank
     */
    private $pos;

    /**
     * @var string
     *
     * @ORM\Column(name="description", type="string", length=255, nullable=true)
     */
    private $description;

    /**
     * @var \AppBundle\Entity\FewoLodging
     *
     * @ORM\ManyToOne(targetEntity="FewoLodging", inversedBy="images")
     * @ORM\JoinColumns({
     *  @ORM\JoinColumn(name="lodging_id", referencedColumnName="id", onDelete="SET NULL")
     * })
     */
    private $lodging;


    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set file
     *
     * @param string $file
     *
     * @return FewoLodgingImage
     */
    public function setFile($file)
    {
        $this->file = $file;

        return $this;
    }

    /**
     * Get file
     *
     * @return string
     */
    public function getFile()
    {
        return $this->file;
    }

      /**
     * Set pos
     *
     * @param string $pos
     *
     * @return FewoLodgingImage
     */
    public function setPos($pos)
    {
        $this->pos = $pos;

        return $this;
    }

    /**
     * Get pos
     *
     * @return string
     */
    public function getPos()
    {
        return $this->pos;
    }


    /**
     * Set description
     *
     * @param string $description
     *
     * @return FewoLodgingImage
     */
    public function setDescription($description)
    {
        $this->description = $description;

        return $this;
    }

    /**
     * Get description
     *
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Set lodging
     *
     * @param \AppBundle\Entity\FewoLodging $lodging
     *
     * @return FewoLodgingImage
     */
    public function setLodging(\AppBundle\Entity\FewoLodging $lodging = null)
    {
        $this->lodging = $lodging;

        return $this;
    }

    /**
     * Get lodging
     *
     * @return \AppBundle\Entity\FewoLodging
     */
    public function getLodging()
    {
        return $this->lodging;
    }

    function __toString()
    {
        return $this->file;
    }

    /**
     * Set fileName
     *
     * @param string $fileName
     *
     * @return FewoLodgingImage
     */
    public function setFileName($fileName)
    {
        $this->fileName = $fileName;

        return $this;
    }

    /**
     * Get fileName
     *
     * @return string
     */
    public function getFileName()
    {
        return $this->fileName;
    }
}
