<?php

namespace App\Entity;

use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;


use JMS\Serializer\Annotation\ExclusionPolicy;
use JMS\Serializer\Annotation\Expose;
use JMS\Serializer\Annotation\Groups;
use JMS\Serializer\Annotation\VirtualProperty;

/**
 * @ORM\Entity(repositoryClass="App\Entity\ProfileRepository")
 * @ORM\Table(name="profile")
 * @ORM\HasLifecycleCallbacks
 * @ExclusionPolicy("all") 
 */
class Profile
{
    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     * @Expose
     */
    private $id;

    /**
     * @ORM\OneToOne(targetEntity="User")
     * @ORM\JoinColumn(name="user", referencedColumnName="id")
     * @Expose
     **/
    private $user;

    /**
     * @ORM\OneToMany(targetEntity="App\Entity\Project", mappedBy="profile", cascade={"remove"})
     * @Expose
     **/
    private $projects;

    /**
     * @ORM\OneToMany(targetEntity="App\Entity\Reply", mappedBy="profile", cascade={"remove"})
     * @Expose
     **/
    private $replies;


    /**
     * @ORM\OneToMany(targetEntity="App\Entity\Showcase", mappedBy="profile", cascade={"remove"})
     * @Expose
     **/
    private $showcases;


    /**
     * @ORM\OneToMany(targetEntity="App\Entity\ProfileCategory", mappedBy="profile", cascade={"remove"})
     **/
    private $categories;

    /**
     *
     * @ORM\Column(name="old_id", type="integer", nullable=true)
     */
    private $oldId;

    /**
     * @var string $role
     *
     * @ORM\Column(name="role", type="string", nullable=true)
     */
    private $role;

    /**
     *
     * @ORM\Column(type="boolean", nullable=true)
     */
    private $status;

    /**
     * @var string $mobile
     *
     * @ORM\Column(name="mobile", type="string", nullable=true)
     * @Expose
     */
    private $mobile;

    /**
     * @var string $fullname
     *
     * @ORM\Column(name="fullname", type="string", nullable=true)
     * @Expose
     */
    private $fullname;

    /**
     * @var string $civility
     *
     * @ORM\Column(name="civility", type="string", nullable=true)
     * @Expose
     */
    private $civility;

    /**
     * @var date $birthday
     *
     * @ORM\Column(name="birthday", type="date", nullable=true)
     * @Expose
     */
    private $birthday;

    /**
     * @var string $firstname
     *
     * @ORM\Column(name="firstname", type="string", nullable=true)
     * @Expose
     */
    private $firstname;

    /**
     * @var string $lastname
     *
     * @ORM\Column(name="lastname", type="string", nullable=true)
     * @Expose
     */
    private $lastname;

    /**
     * @ORM\OneToOne(targetEntity="App\Entity\Document", cascade={"persist"})
     * @Expose
     */
    private $avatar;

    /**
     * @var string $website
     *
     * @ORM\Column(name="website", type="string", nullable=true)
     */
    private $website;

    /**
     * @var string $department
     *
     * @ORM\Column(name="department", type="string", nullable=true)
     */
    private $department;

    /**
     * @var string $address
     *
     * @ORM\Column(name="address", type="string", nullable=true)
     */
    private $address;

    /**
     * @var string $city
     *
     * @ORM\Column(name="city", type="string", nullable=true)
     */
    private $city;

    /**
     * @var string $state
     *
     * @ORM\Column(name="state", type="string", nullable=true)
     */
    private $state;

    /**
     * @var string $state_second
     *
     * @ORM\Column(name="state_second", type="string", nullable=true)
     */
    private $state_second;

    /**
     * @var string $country
     *
     * @ORM\Column(name="country", type="string", nullable=true)
     */
    private $country;

    /**
     * @ORM\Column(name="lat", type="decimal", precision=10, scale=8, nullable=true)
     */
    protected $lat;

    /**
     * @ORM\Column(name="lng", type="decimal", precision=11, scale=8, nullable=true)
     */
    protected $lng;


    /**
     * @var string $content
     *
     * @ORM\Column(name="content", type="text", nullable=true)
     * @Expose
     */
    private $content;

    /**
     * @var integer
     *
     * @ORM\Column(name="cesu_urssaf", type="integer", nullable=true)
     * @Expose     
     */
    private $cesu;

    /**
     * @var string $mailformat
     *
     * @ORM\Column(name="mail_format", type="string", nullable=true)
     */
    private $mailFormat = 1;

    /**
     *
     * @ORM\Column(type="boolean", nullable=true)
     */
    private $notifications;

    /**
     *
     * @ORM\Column(type="boolean", nullable=true)
     */
    private $deleted;
    /**
     * @Gedmo\Timestampable(on="create")
     * @Doctrine\ORM\Mapping\Column(type="datetime", nullable=true)
     */
    private $created;

    /**
     * @var \DateTime $updated
     *
     * @Gedmo\Timestampable(on="update")
     * @ORM\Column(type="datetime", nullable=true)
     */
    private $modified;

    public function __toString() {
        return $this->getUser()->getUsername();
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set user
     *
     * @param \App\Entity\User $user
     *
     * @return Profile
     */
    public function setUser(\App\Entity\User $user = null)
    {
        $this->user = $user;

        return $this;
    }

    /**
     * Get user
     *
     * @return \App\Entity\User
     */
    public function getUser()
    {
        return $this->user;
    }

    /**
     * Set role
     *
     * @param string $role
     *
     * @return Profile
     */
    public function setRole($role)
    {
        $this->role = $role;

        return $this;
    }

    /**
     * Get role
     *
     * @return string
     */
    public function getRole()
    {
        return $this->role;
    }

    /**
     * Set firstname
     *
     * @param string $firstname
     *
     * @return Profile
     */
    public function setFirstname($firstname)
    {
        $this->firstname = $firstname;

        return $this;
    }

    /**
     * Get firstname
     *
     * @return string
     */
    public function getFirstname()
    {
        return $this->firstname;
    }

    /**
     * Set lastname
     *
     * @param string $lastname
     *
     * @return Profile
     */
    public function setLastname($lastname)
    {
        $this->lastname = $lastname;

        return $this;
    }

    /**
     * Get lastname
     *
     * @return string
     */
    public function getLastname()
    {
        return $this->lastname;
    }

    /**
     * Set content
     *
     * @param string $content
     *
     * @return Profile
     */
    public function setContent($content)
    {
        $this->content = $content;

        return $this;
    }

    /**
     * Get content
     *
     * @return string
     */
    public function getContent()
    {
        return $this->content;
    }

    /**
     * Set fullname
     *
     * @param string $fullname
     *
     * @return Profile
     */
    public function setFullname($fullname)
    {
        $this->fullname = $fullname;

        return $this;
    }

    /**
     * Get fullname
     *
     * @return string
     */
    public function getFullname()
    {
        return $this->fullname;
    }


    /**
     * Set oldId
     *
     * @param integer $oldId
     *
     * @return Profile
     */
    public function setOldId($oldId)
    {
        $this->old_id = $oldId;

        return $this;
    }

    /**
     * Get oldId
     *
     * @return integer
     */
    public function getOldId()
    {
        return $this->oldId;
    }

    /**
     * Set status
     *
     * @param integer $status
     *
     * @return Profile
     */
    public function setStatus($status)
    {
        $this->status = $status;

        return $this;
    }

    /**
     * Get status
     *
     * @return integer
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * Set website
     *
     * @param string $website
     *
     * @return Profile
     */
    public function setWebsite($website)
    {
        $this->website = $website;

        return $this;
    }

    /**
     * Get website
     *
     * @return string
     */
    public function getWebsite()
    {
        return $this->website;
    }

    /**
     * Set department
     *
     * @param string $department
     *
     * @return Profile
     */
    public function setDepartment($department)
    {
        $this->department = $department;

        return $this;
    }

    /**
     * Get department
     *
     * @return string
     */
    public function getDepartment()
    {
        return $this->department;
    }

    /**
     * Set avatar
     *
     * @param \App\Entity\Document $avatar
     *
     * @return Profile
     */
    public function setAvatar(\App\Entity\Document $avatar = null)
    {
        $this->avatar = $avatar;

        return $this;
    }

    /**
     * Get avatar
     *
     * @return \App\Entity\Document
     */
    public function getAvatar()
    {
        return $this->avatar;
    }

    /**
     * Set created
     *
     * @param \DateTime $created
     *
     * @return Profile
     */
    public function setCreated($created)
    {
        $this->created = $created;

        return $this;
    }

    /**
     * Get created
     *
     * @return \DateTime
     */
    public function getCreated()
    {
        return $this->created;
    }

    /**
     * Set modified
     *
     * @param \DateTime $modified
     *
     * @return Profile
     */
    public function setModified($modified)
    {
        $this->modified = $modified;

        return $this;
    }

    /**
     * Get modified
     *
     * @return \DateTime
     */
    public function getModified()
    {
        return $this->modified;
    }
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->projects = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Add project
     *
     * @param \App\Entity\Project $project
     *
     * @return Profile
     */
    public function addProject(\App\Entity\Project $project)
    {
        $this->projects[] = $project;

        return $this;
    }

    /**
     * Remove project
     *
     * @param \App\Entity\Project $project
     */
    public function removeProject(\App\Entity\Project $project)
    {
        $this->projects->removeElement($project);
    }

    /**
     * Get projects
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getProjects()
    {
        return $this->projects;
    }

    /**
     * Add reply
     *
     * @param \App\Entity\Reply $reply
     *
     * @return Profile
     */
    public function addReply(\App\Entity\Reply $reply)
    {
        $this->replies[] = $reply;

        return $this;
    }

    /**
     * Remove reply
     *
     * @param \App\Entity\Reply $reply
     */
    public function removeReply(\App\Entity\Reply $reply)
    {
        $this->replies->removeElement($reply);
    }

    /**
     * Get replies
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getReplies()
    {
        return $this->replies;
    }

    /**
     * Add showcase
     *
     * @param \App\Entity\Showcase $showcase
     *
     * @return Profile
     */
    public function addShowcase(\App\Entity\Showcase $showcase)
    {
        $this->showcases[] = $showcase;

        return $this;
    }

    /**
     * Remove showcase
     *
     * @param \App\Entity\Showcase $showcase
     */
    public function removeShowcase(\App\Entity\Showcase $showcase)
    {
        $this->showcases->removeElement($showcase);
    }

    /**
     * Get showcases
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getShowcases()
    {
        return $this->showcases;
    }

    /**
     * Set mailFormat
     *
     * @param string $mailFormat
     *
     * @return Profile
     */
    public function setMailFormat($mailFormat)
    {
        $this->mailFormat = $mailFormat;

        return $this;
    }

    /**
     * Get mailFormat
     *
     * @return string
     */
    public function getMailFormat()
    {
        return $this->mailFormat;
    }

    /**
     * Set notifications
     *
     * @param boolean $notifications
     *
     * @return Profile
     */
    public function setNotifications($notifications)
    {
        $this->notifications = $notifications;

        return $this;
    }

    /**
     * Get notifications
     *
     * @return boolean
     */
    public function getNotifications()
    {
        return $this->notifications;
    }

    /**
     * Set deleted
     *
     * @param boolean $deleted
     *
     * @return Profile
     */
    public function setDeleted($deleted)
    {
        $this->deleted = $deleted;

        return $this;
    }

    /**
     * Get deleted
     *
     * @return boolean
     */
    public function getDeleted()
    {
        return $this->deleted;
    }

    /**
     * Set address
     *
     * @param string $address
     *
     * @return Profile
     */
    public function setAddress($address)
    {
        $this->address = $address;

        return $this;
    }

    /**
     * Get address
     *
     * @return string
     */
    public function getAddress()
    {
        return $this->address;
    }

    /**
     * Set lat
     *
     * @param string $lat
     *
     * @return Profile
     */
    public function setLat($lat)
    {
        $this->lat = $lat;

        return $this;
    }

    /**
     * Get lat
     *
     * @return string
     */
    public function getLat()
    {
        return $this->lat;
    }

    /**
     * Set lng
     *
     * @param string $lng
     *
     * @return Profile
     */
    public function setLng($lng)
    {
        $this->lng = $lng;

        return $this;
    }

    /**
     * Get lng
     *
     * @return string
     */
    public function getLng()
    {
        return $this->lng;
    }

    /**
     * Set mobile
     *
     * @param string $mobile
     *
     * @return Profile
     */
    public function setMobile($mobile)
    {
        $this->mobile = $mobile;

        return $this;
    }

    /**
     * Get mobile
     *
     * @return string
     */
    public function getMobile()
    {
        return $this->mobile;
    }

    /**
     * Set city
     *
     * @param string $city
     *
     * @return Profile
     */
    public function setCity($city)
    {
        $this->city = $city;

        return $this;
    }

    /**
     * Get city
     *
     * @return string
     */
    public function getCity()
    {
        return $this->city;
    }

    /**
     * Set state
     *
     * @param string $state
     *
     * @return Profile
     */
    public function setState($state)
    {
        $this->state = $state;

        return $this;
    }

    /**
     * Get state
     *
     * @return string
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Set country
     *
     * @param string $country
     *
     * @return Profile
     */
    public function setCountry($country)
    {
        $this->country = $country;

        return $this;
    }

    /**
     * Get country
     *
     * @return string
     */
    public function getCountry()
    {
        return $this->country;
    }


    /**
     * Add category
     *
     * @param \App\Entity\ProfileCategory $category
     *
     * @return Profile
     */
    public function addCategory(\App\Entity\ProfileCategory $category)
    {
        $this->categories[] = $category;

        return $this;
    }

    /**
     * Remove category
     *
     * @param \App\Entity\ProfileCategory $category
     */
    public function removeCategory(\App\Entity\ProfileCategory $category)
    {
        $this->categories->removeElement($category);
    }

    /**
     * Get categories
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getCategories()
    {
        return $this->categories;
    }

    /**
     * Set stateSecond
     *
     * @param string $stateSecond
     *
     * @return Profile
     */
    public function setStateSecond($stateSecond)
    {
        $this->state_second = $stateSecond;

        return $this;
    }

    /**
     * Get stateSecond
     *
     * @return string
     */
    public function getStateSecond()
    {
        return $this->state_second;
    }

    /**
     * Set civility
     *
     * @param string $civility
     *
     * @return Profile
     */
    public function setCivility($civility)
    {
        $this->civility = $civility;

        return $this;
    }

    /**
     * Get civility
     *
     * @return string
     */
    public function getCivility()
    {
        return $this->civility;
    }

    /**
     * Set birthday
     *
     * @param \DateTime $birthday
     *
     * @return Profile
     */
    public function setBirthday($birthday)
    {
        $this->birthday = $birthday;

        return $this;
    }

    /**
     * Get birthday
     *
     * @return \DateTime
     */
    public function getBirthday()
    {
        return $this->birthday;
    }
}
