<?php
namespace Claromentis\People\Filter;

$GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"] = (@$GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"] ?: array()) + array("_680cc2b8220e94c8c32b8bc" . "7c65519b4" => base64_decode("aX" . "Nf" . "aW" . "50"), "_1f50e30be8c2fe" . "fa6881834e71d50" . "4a2" => base64_decode("b2Zmc" . "2V0"), "_f11369824f533e8206f9ccc0c9aab3a" . "0" => base64_decode("bG" . "lt" . "aX" . "Q="));
use Claromentis\Core\Security\SecurityContext;
use Psr\Http\Message\ServerRequestInterface;







abstract class AbstractPeopleFilter
{
    
    
    public $context;
    const DEFAULT_LIMIT = 20;
    const MAX_LIMIT = 200;
    
    
    protected $limit = self::DEFAULT_LIMIT;
    
    
    protected $offset = 0;
    public function __construct(SecurityContext $context)
    {
        $this->context = $context;
    }
    public function IsPaginationSet()
    {
        return $GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_680cc2b8" . "220e94c8c" . "32b8bc7c6" . "5519b4"]($this->limit) && $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_680cc2b8220e" . "94c8c32b8bc7c" . "65519b4"]($this->offset);
    }
    
    
    
    
    
    
    
    
    
    
    public function GetPublicDefaults() : array
    {
        return [$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_f11369824f533e8206f9ccc0c9" . "aab3a0"] => $this->limit, $GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_1f50e30be8c2fefa688" . "1834e71d504a2"] => $this->offset];
    }
    
    
    
    
    
    
    
    
    public function SetPaginationAttributesFromRequest(ServerRequestInterface $request) : void
    {
        $this->SetOffset($request->getAttribute($GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_1f50e30be8c2fefa6881834e71d504" . "a2"], 0));
        $this->SetLimit($request->getAttribute($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_f11369824f533" . "e8206f9ccc0c9a" . "ab3a0"], self::DEFAULT_LIMIT));
    }
    
    
    
    
    
    
    public function SetLimit(int $_f11369824f533e8206f9ccc0c9aab3a0) : void
    {
        if (!$GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_680cc2b8" . "220e94c8c" . "32b8bc7c6" . "5519b4"]($_f11369824f533e8206f9ccc0c9aab3a0) || $_f11369824f533e8206f9ccc0c9aab3a0 <= 0) {
            return;
        }
        if ($_f11369824f533e8206f9ccc0c9aab3a0 > self::MAX_LIMIT) {
            $_f11369824f533e8206f9ccc0c9aab3a0 = self::MAX_LIMIT;
        }
        $this->limit = $_f11369824f533e8206f9ccc0c9aab3a0;
    }
    
    
    
    
    
    
    public function SetOffset(int $_1f50e30be8c2fefa6881834e71d504a2) : void
    {
        if (!$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_680cc2b8220e" . "94c8c32b8bc7c" . "65519b4"]($_1f50e30be8c2fefa6881834e71d504a2) || $_1f50e30be8c2fefa6881834e71d504a2 < 0) {
            return;
        }
        $this->offset = $_1f50e30be8c2fefa6881834e71d504a2;
    }
    
    
    
    
    public function Limit() : int
    {
        return $this->limit;
    }
    
    
    
    
    public function Offset() : int
    {
        return $this->offset;
    }
}