<?php

namespace AppBundle\Entity;

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

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

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


     /**
     * @ORM\OneToMany(targetEntity="FewoLodging", mappedBy="group", cascade={"persist", "remove"})
     */
    private $lodgings;

     //------------------------------------------------------------------------------------------------------------------
    // Bilder

    /**
     * @ORM\OneToMany(targetEntity="FewoLodgingGroupImage", mappedBy="lodgingGroup", cascade={"persist", "remove"})
     * @ORM\OrderBy({"pos" = "ASC"})
     */
    private $images;

     /**
     * Constructor
     */
    public function __construct()
    {
        $this->images = new \Doctrine\Common\Collections\ArrayCollection();
    }


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

    /**
     * Get lodgings
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getLodgings()
    {
        return $this->lodgings;
    }

     /**
     * Add image
     *
     * @param \AppBundle\Entity\FewoLodgingGroupImage $image
     *
     * @return FewoLodging
     */
    public function addImage(\AppBundle\Entity\FewoLodgingGroupImage $image)
    {
        $this->images[] = $image;

        return $this;
    }

    /**
     * Remove image
     *
     * @param \AppBundle\Entity\FewoLodgingGroupImage $image
     */
    public function removeImage(\AppBundle\Entity\FewoLodgingGroupImage $image)
    {
        $this->images->removeElement($image);
    }

    /**
     * Get images
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getImages()
    {
        return $this->images;
    }


    /**
     * Set name
     *
     * @param string $name
     *
     * @return FewoLodgingType
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

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

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



}
