<?php

namespace OfficeBrain\Bundle\ServiceGroupBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as GEDMO;

/**
 * Entity For service Group.
 *
 * @author (modify) OfficeBrain 4589
 */

/**
 * ServiceGroup.
 *
 * @ORM\Table(name="tbl_service_group")
 * @ORM\Entity(repositoryClass="OfficeBrain\Bundle\ServiceGroupBundle\Entity\ServiceGroupRepository")
 * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false)
 */
class ServiceGroup
{
    const STATUS_ACTIVE = 1;
    const STATUS_PENDING = 0;

    /**
     * @var int @ORM\Column(name="id", type="bigint", options={"unsigned":true})
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var int
     *
     * @ORM\Column(name="country_id", type="bigint")
     */
    private $countryId;

    /**
     * @var \integer
     *
     * @ORM\Column(name="instance_id", type="integer",length=11,nullable=true)
     */
    private $instanceId;

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

    /**
     * @var int @ORM\Column(name="status", type="integer", length=4, nullable=true)
     */
    private $status = self::STATUS_ACTIVE;
    
    /**
     * @var int @ORM\Column(name="is_default", type="integer", length=1, nullable=false)
     */
    private $isDefault = 0;

    /**
     * @var datetime
     *
     * @Gedmo\Timestampable(on="create")
     * @ORM\Column(name="created_at",type="datetime")
     */
    protected $createdAt;

    /**
     * @var datetime
     *
     * @Gedmo\Timestampable(on="update")
     * @ORM\Column( name="updated_at", type="datetime",nullable=true)
     */
    protected $updatedAt;

    /**
     * @var datetime
     *
     * @ORM\Column(name="deleted_at",type="datetime",  nullable=true)
     */
    protected $deletedAt;

    /**
     * @var int
     * @ORM\Column(name="created_uid", type="bigint" ,length=20 ,options={"unsigned"=true})
     */
    private $createdUid;

    /**
     * @var int
     * @ORM\Column(name="updated_uid", type="bigint" ,length=20 ,options={"unsigned"=true}, nullable=true)
     */
    private $updatedUid;

    /**
     * @var int
     * @ORM\Column(name="deleted_uid", type="bigint" ,length=20 ,options={"unsigned"=true}, nullable=true)
     */
    private $deletedUid;

    /**
     * @ORM\OneToMany(targetEntity="\OfficeBrain\Bundle\UserBundle\Entity\User", mappedBy="serviceGroup")
     * @ORM\JoinColumn(nullable=true)
     */
    private $user;

    /**
     * @ORM\OneToMany(targetEntity="ServiceGroupLanguage", mappedBy="serviceGroup", cascade={"all"})
     */
    private $languageMapping;

    /**
     * @ORM\OneToMany(targetEntity="ServiceRuleMappingGroup", mappedBy="serviceGroupId")
     */
    private $serviceRuleMapGroupId;

    /**
     * Set id.
     *
     * @param int $id
     *
     * @return ServiceGroup
     */
    public function setId($id)
    {
        $this->id = $id;

        return $this;
    }

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

    /**
     * Set status.
     *
     * @param int $status
     *
     * @return ServiceGroup
     */
    public function setStatus($status)
    {
        $this->status = $status;

        return $this;
    }

    /**
     * Get status.
     *
     * @return int
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * Set createdAt.
     *
     * @param \DateTime $createdAt
     *
     * @return ServiceGroup
     */
    public function setCreatedAt($createdAt)
    {
        $this->createdAt = $createdAt;

        return $this;
    }

    /**
     * Get createdAt.
     *
     * @return \DateTime
     */
    public function getCreatedAt()
    {
        return $this->createdAt;
    }

    /**
     * Set updatedAt.
     *
     * @param \DateTime $updatedAt
     *
     * @return ServiceGroup
     */
    public function setUpdatedAt($updatedAt)
    {
        $this->updatedAt = $updatedAt;

        return $this;
    }

    /**
     * Get updatedAt.
     *
     * @return \DateTime
     */
    public function getUpdatedAt()
    {
        return $this->updatedAt;
    }

    /**
     * Set deletedAt.
     *
     * @param \DateTime $deletedAt
     *
     * @return ServiceGroup
     */
    public function setDeletedAt($deletedAt)
    {
        $this->deletedAt = $deletedAt;

        return $this;
    }

    /**
     * Get deletedAt.
     *
     * @return \DateTime
     */
    public function getDeletedAt()
    {
        return $this->deletedAt;
    }

    /**
     * Set createdUid.
     *
     * @param int $createdUid
     *
     * @return ServiceGroup
     */
    public function setCreatedUid($createdUid)
    {
        $this->createdUid = $createdUid;

        return $this;
    }

    /**
     * Get createdUid.
     *
     * @return int
     */
    public function getCreatedUid()
    {
        return $this->createdUid;
    }

    /**
     * Set updatedUid.
     *
     * @param int $updatedUid
     *
     * @return ServiceGroup
     */
    public function setUpdatedUid($updatedUid)
    {
        $this->updatedUid = $updatedUid;

        return $this;
    }

    /**
     * Get updatedUid.
     *
     * @return int
     */
    public function getUpdatedUid()
    {
        return $this->updatedUid;
    }

    /**
     * Set deletedUid.
     *
     * @param int $deletedUid
     *
     * @return ServiceGroup
     */
    public function setDeletedUid($deletedUid)
    {
        $this->deletedUid = $deletedUid;

        return $this;
    }

    /**
     * Get deletedUid.
     *
     * @return int
     */
    public function getDeletedUid()
    {
        return $this->deletedUid;
    }
    /**
     * Constructor.
     */
    public function __construct()
    {
        $this->user = new \Doctrine\Common\Collections\ArrayCollection();
        $this->languageMapping = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Add user.
     *
     * @param \OfficeBrain\Bundle\UserBundle\Entity\User $user
     *
     * @return ServiceGroup
     */
    public function addUser(\OfficeBrain\Bundle\UserBundle\Entity\User $user)
    {
        $this->user[] = $user;

        return $this;
    }

    /**
     * Remove user.
     *
     * @param \OfficeBrain\Bundle\UserBundle\Entity\User $user
     */
    public function removeUser(\OfficeBrain\Bundle\UserBundle\Entity\User $user)
    {
        $this->user->removeElement($user);
    }

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

    /**
     * Add languageMapping.
     *
     * @param ServiceGroupLanguage $languageMapping
     *
     * @return Coupon
     */
    public function addLanguageMapping(ServiceGroupLanguage $languageMapping)
    {
        $this->languageMapping[] = $languageMapping;

        return $this;
    }

    /**
     * Remove languageMapping.
     *
     * @param ServiceGroupLanguage $languageMapping
     */
    public function removeLanguageMapping(ServiceGroupLanguage $languageMapping)
    {
        $this->languageMapping->removeElement($languageMapping);
    }

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

    /**
     * Set instanceId.
     *
     * @param int $instanceId
     *
     * @return Coupon
     */
    public function setInstanceId($instanceId)
    {
        $this->instanceId = $instanceId;

        return $this;
    }

    /**
     * Get instanceId.
     *
     * @return int
     */
    public function getInstanceId()
    {
        return $this->instanceId;
    }

    /**
     * Set instanceType.
     *
     * @param string $instanceType
     *
     * @return Coupon
     */
    public function setInstanceType($instanceType)
    {
        $this->instanceType = $instanceType;

        return $this;
    }

    /**
     * Get instanceType.
     *
     * @return string
     */
    public function getInstanceType()
    {
        return $this->instanceType;
    }

    /**
     * Set countryId.
     *
     * @param int $countryId
     *
     * @return ServiceGroup
     */
    public function setCountryId($countryId)
    {
        $this->countryId = $countryId;

        return $this;
    }

    /**
     * Get countryId.
     *
     * @return int
     */
    public function getCountryId()
    {
        return $this->countryId;
    }

    /**
     * Add serviceRuleMapGroupId.
     *
     * @param \OfficeBrain\Bundle\ServiceGroupBundle\Entity\ServiceRuleMappingGroup $serviceRuleMapGroupId
     *
     * @return ServiceGroup
     */
    public function addServiceRuleMapGroupId(\OfficeBrain\Bundle\ServiceGroupBundle\Entity\ServiceRuleMappingGroup $serviceRuleMapGroupId)
    {
        $this->serviceRuleMapGroupId[] = $serviceRuleMapGroupId;

        return $this;
    }

    /**
     * Remove serviceRuleMapGroupId.
     *
     * @param \OfficeBrain\Bundle\ServiceGroupBundle\Entity\ServiceRuleMappingGroup $serviceRuleMapGroupId
     */
    public function removeServiceRuleMapGroupId(\OfficeBrain\Bundle\ServiceGroupBundle\Entity\ServiceRuleMappingGroup $serviceRuleMapGroupId)
    {
        $this->serviceRuleMapGroupId->removeElement($serviceRuleMapGroupId);
    }

    /**
     * Get serviceRuleMapGroupId.
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getServiceRuleMapGroupId()
    {
        return $this->serviceRuleMapGroupId;
    }
    
    /**
     * Set isDefault.
     *
     * @param int $isDefault
     *
     * @return ServiceGroup
     */
    public function setIsDefault($isDefault)
    {
        $this->isDefault = $isDefault;
    
        return $this;
    }
    
    /**
     * Get isDefault.
     *
     * @return int
     */
    public function getIsDefault()
    {
        return $this->isDefault;
    }
}
