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

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"] = (@$GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"] ?: array()) + array("us" . "er" . "id" => base64_decode("dXNl" . "cmlk"), "_9e2e18ee304be5414883" . "9b0c0e58d0db" => base64_decode("dXNlcl9ncm91" . "cHM="), "par" . "ent" . "_id" => base64_decode("cGFyZW5" . "0X2lk"), "_35b54f844f87" . "c3db31eca4228" . "4fefc39" => base64_decode("ZXhfYXJlYV9pZ" . "A=="), "_fd3573b" . "00e549f3" . "34fe5f4d" . "7536a53c" . "a" => base64_decode("Z3JvdXBpZA=" . "="));
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["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["parent_" . "id"]);
    }
    
    
    
    
    
    
    
    
    
    
    public function subgroups(Group $_e9208e4fb555ac989f7519e19c1da810)
    {
        return $this->hasMany($_e9208e4fb555ac989f7519e19c1da810, Group::class, $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["par" . "ent" . "_id"]);
    }
    
    
    
    
    
    
    
    
    
    
    public function users(Group $_e9208e4fb555ac989f7519e19c1da810)
    {
        return $this->belongsToMany($_e9208e4fb555ac989f7519e19c1da810, User::class, $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_9e2e18ee304be54148839b0c0e58" . "d0db"], $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_fd3573b0" . "0e549f334" . "fe5f4d753" . "6a53ca"], $GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["user" . "id"]);
    }
    
    
    
    
    
    
    
    
    public function extranet(Group $_e9208e4fb555ac989f7519e19c1da810)
    {
        return $this->belongsTo($_e9208e4fb555ac989f7519e19c1da810, Extranet::class, $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_35b54f844f8" . "7c3db31eca42" . "284fefc39"]);
    }
}