<?php

namespace RxConnexionBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use RxConnexionBundle\Entity\Base\BaseEntity;
use JMS\Serializer\Annotation\MaxDepth;

/**
 * @ORM\Entity(repositoryClass="RxConnexionBundle\Repository\UserGroupRepository")
 * @ORM\Table(name="user_group")
 */

class UserGroupEntity extends BaseEntity
{

    /**
     * @ORM\Column(name="is_deleted", type="boolean")
     */
    protected $isDeleted;

    /**
     * @ORM\Column(type="string", nullable=true)
     */
    protected $code;

    /**
     * @ORM\Column(type="string")
     */
    protected $description;

    /**
     * @ORM\OneToMany(targetEntity="UserGroupAccountUserEntity", mappedBy="userGroup", cascade={"remove"})
     */
    protected $userGroupAccountUsers;

    /**
     * @ORM\OneToMany(targetEntity="AccountUserReminderEntity", mappedBy="assignedToUserGroup", cascade={"remove"})
     */
    protected $assignedToAccountUserReminders;


    public function __construct()
    {
        $this->userGroupAccountUsers = new ArrayCollection();
        $this->assignedToAccountUserReminders = new ArrayCollection();
    }

    /**
     * Set createdAt
     *
     * @ORM\PrePersist
     */
    public function setCreatedAtValue()
    {
        parent::setCreatedAtValue();
        $this->isDeleted = 0;
    }


    /*--------------------------------------------------------------------------------------------------------*/
    /*					User Defined Setters and Getters													  */
    /*--------------------------------------------------------------------------------------------------------*/


    /*--------------------------------------------------------------------------------------------------------*/
    /*					Setters and Getters																	  */
    /*--------------------------------------------------------------------------------------------------------*/



    /**
     * Set isDeleted
     *
     * @param boolean $isDeleted
     *
     * @return UserGroupEntity
     */
    public function setIsDeleted($isDeleted)
    {
        $this->isDeleted = $isDeleted;

        return $this;
    }

    /**
     * Get isDeleted
     *
     * @return boolean
     */
    public function getIsDeleted()
    {
        return $this->isDeleted;
    }

    /**
     * Set code
     *
     * @param string $code
     *
     * @return UserGroupEntity
     */
    public function setCode($code)
    {
        $this->code = $code;

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Add userGroupAccountUser
     *
     * @param \RxConnexionBundle\Entity\UserGroupAccountUserEntity $userGroupAccountUser
     *
     * @return UserGroupEntity
     */
    public function addUserGroupAccountUser(\RxConnexionBundle\Entity\UserGroupAccountUserEntity $userGroupAccountUser)
    {
        $this->userGroupAccountUsers[] = $userGroupAccountUser;

        return $this;
    }

    /**
     * Remove userGroupAccountUser
     *
     * @param \RxConnexionBundle\Entity\UserGroupAccountUserEntity $userGroupAccountUser
     */
    public function removeUserGroupAccountUser(\RxConnexionBundle\Entity\UserGroupAccountUserEntity $userGroupAccountUser)
    {
        $this->userGroupAccountUsers->removeElement($userGroupAccountUser);
    }

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

    /**
     * Add assignedToAccountUserReminder
     *
     * @param \RxConnexionBundle\Entity\AccountUserReminderEntity $assignedToAccountUserReminder
     *
     * @return UserGroupEntity
     */
    public function addAssignedToAccountUserReminder(\RxConnexionBundle\Entity\AccountUserReminderEntity $assignedToAccountUserReminder)
    {
        $this->assignedToAccountUserReminders[] = $assignedToAccountUserReminder;

        return $this;
    }

    /**
     * Remove assignedToAccountUserReminder
     *
     * @param \RxConnexionBundle\Entity\AccountUserReminderEntity $assignedToAccountUserReminder
     */
    public function removeAssignedToAccountUserReminder(\RxConnexionBundle\Entity\AccountUserReminderEntity $assignedToAccountUserReminder)
    {
        $this->assignedToAccountUserReminders->removeElement($assignedToAccountUserReminder);
    }

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