<?php

/**
 * This is automatically generated file using the Codific Prototizer
 * PHP version 8
 * @category PHP
 * @package  Admin
 * @author   CODIFIC <info@codific.com>
 * @link     http://codific.com
 */

declare(strict_types=1);

namespace App\Entity;

use App\Entity\Abstraction\AbstractEntity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\MaxDepth;
use Symfony\Component\Serializer\Annotation\Ignore;

// #BlockStart number=286 id=_#_0

// #BlockEnd number=286


#[ORM\Table(name: "`group_user`")]
#[ORM\Entity(repositoryClass: "App\Repository\GroupUserRepository")]
#[ORM\HasLifecycleCallbacks]
class GroupUser extends AbstractEntity
{
    #[ORM\ManyToOne(targetEntity: Group::class, cascade: ["persist"], inversedBy: "groupGroupUsers", fetch: "LAZY")]
    #[ORM\JoinColumn(onDelete: "SET NULL")]
    private Group $group;

    #[ORM\ManyToOne(targetEntity: User::class, cascade: ["persist"], inversedBy: "userGroupUsers", fetch: "LAZY")]
    #[ORM\JoinColumn(onDelete: "SET NULL")]
    private User $user;

    /**
     * Set group
     */
    public function setGroup(Group $group): GroupUser
    {
        $this->group = $group;
        return $this;
    }

    /**
     * Get group
     * @return Group|null
     */
    public function getGroup(): ?Group
    {
        return $this->group;
    }

    /**
     * Set user
     */
    public function setUser(User $user): GroupUser
    {
        $this->user = $user;
        return $this;
    }

    /**
     * Get user
     * @return User|null
     */
    public function getUser(): ?User
    {
        return $this->user;
    }

    #[Ignore]
    public static array $manyToManyProperties = [];
    
    #[Ignore]
    public static array $childProperties = [
    ];

     /**
     * This method is a copy constructor that will return a copy object (except for the id field)
     * Note that this method will not save the object
     */
    #[Ignore]
    public function getCopy(?GroupUser $clone = null): GroupUser
    {
        if ($clone === null) {
            $clone = new GroupUser();
        }
// #BlockStart number=287 id=_#_1

// #BlockEnd number=287

        return $clone;
    }


    /**
     * Private to string method auto generated based on the UML properties
     * This is the new way of doing things.
     */
    public function toString(): string
    {
        return "";
    }

// #BlockStart number=288 id=_#_2

    /**
     * The toString method based on the private __toString autogenerated method
     * If necessary override.
     */
    public function __toString(): string
    {
        return $this->toString();
    }

// #BlockEnd number=288

}
