<?php
namespace Claromentis\People\Validator;

$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"] = (@$GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"] ?: array()) + array("_f77bfca3490ee" . "96b0c88c8733ef" . "e7c5c" => base64_decode("RXh0cmFuZX" . "Qgd2l0aCBJ" . "RCA="), "_874aa0828" . "603531aa90" . "3a571bb923" . "7d5" => base64_decode("Um9sZXMgbm90IGZvdW5kO" . "iA="), "_4f37e4c6e" . "72824c8465" . "a417cf6baf" . "28c" => base64_decode("T3duZXIgVXNlciB3a" . "XRoIElEIA=="), "_01f117d" . "b67aa749" . "d3ec8da7" . "eb478730" . "c" => base64_decode("L" . "C" . "A" . "="), "_aed8da0f19" . "091214b78f8" . "0351048517c" => base64_decode("c3" . "Ry" . "bG" . "Vu"), "_fa96cdf58bff" . "3b0695fb2bc08" . "03d7b12" => base64_decode("IGRvZX" . "Mgbm90" . "IGV4aX" . "N0"), "_b66252d" . "7bbf3610" . "12a6531a" . "8e3a7323" . "0" => base64_decode("YXJyY" . "XlfZG" . "lmZg=" . "="), "_6cdbcf0" . "3fabfd1e" . "2e5a9fae" . "cf8aeb52" . "9" => base64_decode("Um9sZSBuYW1lIGNhbm5vdCBiZSBlbX" . "B0eQ=="), "_5159b357" . "2969eca46" . "acd1b2e14" . "18459c" => base64_decode("aW1wbG9kZQ=" . "="));
use Analogue\ORM\EntityCollection;
use Analogue\ORM\Exceptions\MappingException;
use Claromentis\People\Entity\Role;
use Claromentis\People\Exception\NotFoundException;
use Claromentis\People\Exception\ValidationException;
use Claromentis\People\Repository\ExtranetRepository;
use Claromentis\People\Repository\UserRepository;




class RoleValidator
{
    
    
    
    
    protected $extranet_validator;
    
    
    
    
    protected $extranet_repository;
    
    
    
    
    protected $user_repository;
    
    
    
    
    
    
    public function __construct(ExtranetValidator $_7770a6202a4c8e22f01e05ca4a137c37, ExtranetRepository $_4af3095f20a1f91b94a8762557924437, UserRepository $_eeeeb0d673b7b0fd0bdca58b5541c3e0)
    {
        $this->extranet_validator = $_7770a6202a4c8e22f01e05ca4a137c37;
        $this->extranet_repository = $_4af3095f20a1f91b94a8762557924437;
        $this->user_repository = $_eeeeb0d673b7b0fd0bdca58b5541c3e0;
    }
    
    
    
    
    
    
    
    public function Validate(Role $_d1071a032215f0eb5c4a8ef175f7049d)
    {
        
        
        if (!$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_aed8da0f19091214b7" . "8f80351048517c"]($_d1071a032215f0eb5c4a8ef175f7049d->name)) {
            throw new ValidationException($GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_6cdbcf03fabfd1e2e5a9faecf8aeb5" . "29"]);
        }
        
        
        if ($_d1071a032215f0eb5c4a8ef175f7049d->extranet_id > 0 && !$this->extranet_repository->find($_d1071a032215f0eb5c4a8ef175f7049d->extranet_id)) {
            throw new ValidationException($GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_f77bfca3490e" . "e96b0c88c8733" . "efe7c5c"] . $_d1071a032215f0eb5c4a8ef175f7049d->extranet_id . $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_fa96cdf58b" . "ff3b0695fb2" . "bc0803d7b12"]);
        }
        
        
        if ($_d1071a032215f0eb5c4a8ef175f7049d->owner_id > 0 && !$this->user_repository->find($_d1071a032215f0eb5c4a8ef175f7049d->owner_id)) {
            throw new ValidationException($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_4f37e4c6e7" . "2824c8465a4" . "17cf6baf28c"] . $_d1071a032215f0eb5c4a8ef175f7049d->owner_id . $GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_fa96cdf58bff3b0695fb2bc080" . "3d7b12"]);
        }
    }
    
    
    
    
    
    
    
    
    
    public function ValidateExistence(array $_25fb31f00b26bde87effd4759e283d9f, EntityCollection $_23ab4dd81b6c619f47099ef7c2485a12)
    {
        $_d0f57ef954ac5e3141a0922301fc3ffb = $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_b66252d7bbf361012a6531a" . "8e3a73230"]($_25fb31f00b26bde87effd4759e283d9f, $_23ab4dd81b6c619f47099ef7c2485a12->getEntityKeys());
        if (!empty($_d0f57ef954ac5e3141a0922301fc3ffb)) {
            throw new ValidationException($GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_874aa0828603531aa903a57" . "1bb9237d5"] . $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_5159b3572969eca46acd1b" . "2e1418459c"]($GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_01f117db" . "67aa749d3" . "ec8da7eb4" . "78730c"], $_d0f57ef954ac5e3141a0922301fc3ffb));
        }
    }
}