<?php
namespace Claromentis\People\Entity\Map;

$GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"] ?: array()) + array("_9e2e18ee3" . "04be541488" . "39b0c0e58d" . "0db" => base64_decode("dXNlcl9ncm91cHM" . "="), "_fd3573b00e549f" . "334fe5f4d7536a5" . "3ca" => base64_decode("Z3JvdXBp" . "ZA=="), "paren" . "t_id" => base64_decode("cGFyZ" . "W50X2" . "lk"), "_35b54f844f87c3db3" . "1eca42284fefc39" => base64_decode("ZXhfY" . "XJlYV" . "9pZA=" . "="), "us" . "er" . "id" => base64_decode("dXNl" . "cmlk"));
use Analogue\ORM\Exceptions\MappingException;
use Analogue\ORM\Relationships;
use Claromentis\Core\ORM\EntityMap;
use Claromentis\People\Entity\Extranet;
use Claromentis\People\Entity\Group;
use Claromentis\People\Entity\User;




class GroupMap extends EntityMap
{
    protected $table = 'groups';
    protected $primaryKey = 'groupid';
    protected $attributes = ['groupid', 'groupname', 'description', 'inactive', 'ex_area_id', 'parent_id', 'owner_id'];
    protected $mappings = ['groupid' => 'id', 'groupname' => 'name', 'ex_area_id' => 'extranet_id', 'owner' => 'owner_id'];
    
    
    
    
    
    
    
    
    public function parent(Group $_e9208e4fb555ac989f7519e19c1da810)
    {
        return $this->belongsTo($_e9208e4fb555ac989f7519e19c1da810, Group::class, $GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["parent_" . "id"]);
    }
    
    
    
    
    
    
    
    
    
    
    public function subgroups(Group $_e9208e4fb555ac989f7519e19c1da810)
    {
        return $this->hasMany($_e9208e4fb555ac989f7519e19c1da810, Group::class, $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["paren" . "t_id"]);
    }
    
    
    
    
    
    
    
    
    
    
    public function users(Group $_e9208e4fb555ac989f7519e19c1da810)
    {
        return $this->belongsToMany($_e9208e4fb555ac989f7519e19c1da810, User::class, $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_9e2e18ee304be54148839b0c0e58d" . "0db"], $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_fd3573b00e549" . "f334fe5f4d7536" . "a53ca"], $GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["user" . "id"]);
    }
    
    
    
    
    
    
    
    
    public function extranet(Group $_e9208e4fb555ac989f7519e19c1da810)
    {
        return $this->belongsTo($_e9208e4fb555ac989f7519e19c1da810, Extranet::class, $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_35b54f844" . "f87c3db31e" . "ca42284fef" . "c39"]);
    }
}