Your IP : 216.73.217.117


Current Path : /var/www/v3.cesa.co.za/src/UserBundle/Entity/
Upload File :
Current File : /var/www/v3.cesa.co.za/src/UserBundle/Entity/UserLevel.php

<?php

namespace App\UserBundle\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;

/**
 * UserLevel
 *
 * @ORM\Table(name="userlevels")
 * @ORM\Entity(repositoryClass="App\UserBundle\Repository\UserLevelRepository")
 */
class UserLevel
{

    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @ORM\Column(name="userlevelid", type="integer")
     */
    private $user_level_id;

    /**
     * @ORM\Column(name="userlevelname", type="string", length=50, nullable=false)
     */
    private $user_level_name;

    /**
     * @ORM\Column(type="text", nullable=true)
     */
    private $roles;

    /**
     * @ORM\ManyToMany(targetEntity="\App\UserBundle\Entity\UserList", mappedBy="user_level")
     */
    private $user_list;

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

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getUserLevelName(): ?string
    {
        return $this->user_level_name;
    }

    public function setUserLevelName(string $user_level_name): static
    {
        $this->user_level_name = $user_level_name;

        return $this;
    }

    public function getRoles(): ?string
    {
        return $this->roles;
    }

    public function setRoles(string $roles): static
    {
        $this->roles = $roles;

        return $this;
    }

    /**
     * @return Collection<int, UserList>
     */
    public function getUserList(): Collection
    {
        return $this->user_list;
    }

    public function addUserList(UserList $userList): static
    {
        if (!$this->user_list->contains($userList)) {
            $this->user_list->add($userList);
            $userList->addUserLevel($this);
        }

        return $this;
    }

    public function removeUserList(UserList $userList): static
    {
        if ($this->user_list->removeElement($userList)) {
            $userList->removeUserLevel($this);
        }

        return $this;
    }

    public function getUserLevelId(): ?int
    {
        return $this->user_level_id;
    }

    public function setUserLevelId(int $user_level_id): static
    {
        $this->user_level_id = $user_level_id;

        return $this;
    }

    public function __toString(): string
    {
        return $this->getUserLevelName();
    }
}