<?php

namespace AppBundle\Entity;

use Symfony\Component\Validator\Constraints as Assert;
use Oh\GoogleMapFormTypeBundle\Validator\Constraints as OhAssert;

use Doctrine\ORM\Mapping as ORM;

/**
 * Compagny
 *
 * @ORM\Table(name="compagny")
 * @ORM\Entity(repositoryClass="AppBundle\Repository\CompagnyRepository")
 */
class Compagny
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

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

    /**
     * @var string
     *
     * @ORM\Column(name="latitude", type="decimal", scale=7, nullable=true)
     */
    private $latitude;

    /**
     * @var string
     *
     * @ORM\Column(name="longitude", type="decimal", scale=7, nullable=true)
     */
    private $longitude;

	private $latlng;

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @var bool
     *
     * @ORM\Column(name="partner", type="boolean", nullable=true)
     */
    private $partner;

    /**
     * @var bool
     *
     * @ORM\Column(name="member", type="boolean", nullable=true)
     */
    private $member;
	
	 /**
	 * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Sector")
	 * @ORM\JoinColumn(nullable=true)
	 */
	private $sector;
	
	 /**
	 * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Canton")
	 * @ORM\JoinColumn(nullable=true)
	 */
	private $canton;
	
	 /**
	 * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Image",cascade={"persist"})
	 * @ORM\JoinColumn(nullable=true)
	 */
	private $logo;

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

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

        return $this;
    }

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

    /**
     * Set latitude
     *
     * @param string $latitude
     *
     * @return Compagny
     */
    public function setLatitude($latitude)
    {
        $this->latitude = $latitude;

        return $this;
    }

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

    /**
     * Set longitude
     *
     * @param string $longitude
     *
     * @return Compagny
     */
    public function setLongitude($longitude)
    {
        $this->longitude = $longitude;

        return $this;
    }

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

	 public function setLatLng($latlng)
    {
        $this->setLatitude($latlng['lat']);
        $this->setLongitude($latlng['lng']);
        return $this;
    }

    /**
     * @Assert\NotBlank()
     * @OhAssert\LatLng()
     */
    public function getLatLng()
    {
        return array('lat'=>$this->getLatitude(),'lng'=>$this->getLongitude());
    }
	
    /**
     * Set locationAdresse
     *
     * @param string $locationAdresse
     *
     * @return Compagny
     */
    public function setLocationAdresse($locationAdresse)
    {
        $this->location_adresse = $locationAdresse;

        return $this;
    }

    /**
     * Get locationAdresse
     *
     * @return string
     */
    public function getLocationAdresse()
    {
        return $this->location_adresse;
    }

    /**
     * Set created
     *
     * @param string $created
     *
     * @return Compagny
     */
    public function setCreated($created)
    {
        $this->created = $created;

        return $this;
    }

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

    /**
     * Set street
     *
     * @param string $street
     *
     * @return Compagny
     */
    public function setStreet($street)
    {
        $this->street = $street;

        return $this;
    }

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

    /**
     * Set number
     *
     * @param string $number
     *
     * @return Compagny
     */
    public function setNumber($number)
    {
        $this->number = $number;

        return $this;
    }

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

    /**
     * Set zip
     *
     * @param string $zip
     *
     * @return Compagny
     */
    public function setZip($zip)
    {
        $this->zip = $zip;

        return $this;
    }

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

    /**
     * Set city
     *
     * @param string $city
     *
     * @return Compagny
     */
    public function setCity($city)
    {
        $this->city = $city;

        return $this;
    }

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

    /**
     * Set phone
     *
     * @param string $phone
     *
     * @return Compagny
     */
    public function setPhone($phone)
    {
        $this->phone = $phone;

        return $this;
    }

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

    /**
     * Set director
     *
     * @param string $director
     *
     * @return Compagny
     */
    public function setDirector($director)
    {
        $this->director = $director;

        return $this;
    }

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

    /**
     * Set effective
     *
     * @param string $effective
     *
     * @return Compagny
     */
    public function setEffective($effective)
    {
        $this->effective = $effective;

        return $this;
    }

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

    /**
     * Set website
     *
     * @param string $website
     *
     * @return Compagny
     */
    public function setWebsite($website)
    {
        $this->website = $website;

        return $this;
    }

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

    /**
     * Set website2
     *
     * @param string $website2
     *
     * @return Compagny
     */
    public function setWebsite2($website2)
    {
        $this->website_2 = $website2;

        return $this;
    }

    /**
     * Get website2
     *
     * @return string
     */
    public function getWebsite2()
    {
        return $this->website_2;
    }

    /**
     * Set activity
     *
     * @param string $activity
     *
     * @return Compagny
     */
    public function setActivity($activity)
    {
        $this->activity = $activity;

        return $this;
    }

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

    /**
     * Set partner
     *
     * @param boolean $partner
     *
     * @return Compagny
     */
    public function setPartner($partner)
    {
        $this->partner = $partner;

        return $this;
    }

    /**
     * Get partner
     *
     * @return bool
     */
    public function getPartner()
    {
        return $this->partner;
    }

    /**
     * Set member
     *
     * @param boolean $member
     *
     * @return Compagny
     */
    public function setMember($member)
    {
        $this->member = $member;

        return $this;
    }

    /**
     * Get member
     *
     * @return bool
     */
    public function getMember()
    {
        return $this->member;
    }

    /**
     * Set sector
     *
     * @param \AppBundle\Entity\Sector $sector
     *
     * @return Compagny
     */
    public function setSector(\AppBundle\Entity\Sector $sector = null)
    {
        $this->sector = $sector;

        return $this;
    }

    /**
     * Get sector
     *
     * @return \AppBundle\Entity\Sector
     */
    public function getSector()
    {
        return $this->sector;
    }

    /**
     * Set canton
     *
     * @param \AppBundle\Entity\Canton $canton
     *
     * @return Compagny
     */
    public function setCanton(\AppBundle\Entity\Canton $canton = null)
    {
        $this->canton = $canton;

        return $this;
    }

    /**
     * Get canton
     *
     * @return \AppBundle\Entity\Canton
     */
    public function getCanton()
    {
        return $this->canton;
    }

    /**
     * Set logo
     *
     * @param \AppBundle\Entity\Image $logo
     *
     * @return Compagny
     */
    public function setLogo(\AppBundle\Entity\Image $logo = null)
    {
        $this->logo = $logo;

        return $this;
    }

    /**
     * Get logo
     *
     * @return \AppBundle\Entity\Image
     */
    public function getLogo()
    {
        return $this->logo;
    }
}
