<?php
namespace Claromentis\Infocapture\Filter;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"] ?: array()) + array("_977995ec9267e034bf7d84b69939" . "eaef" => base64_decode("TGltaXQgbXVzdCBiZSBhbiBpbnRlZ" . "2VyLCAn"), "_aa28ebaa9e17fc6a67b3760" . "0d92d6054" => base64_decode("Y3Jl" . "YXRl" . "ZF9k" . "YXRl"), "_fa7fe9b4130a69a5e" . "bf1616436603e27" => base64_decode("JyBna" . "XZlbi" . "c="), "_62d701c3" . "c53404f06" . "345eb3572" . "0a47b4" => base64_decode("aXNfbnVtZXJpYw" . "=="), "_fb09208447" . "8a617534a42" . "360c88e0c9f" => base64_decode("T2Zmc2V0IG11c3QgYmU" . "gYW4gaW50ZWdlciwgJw" . "=="), "_7608a2690229" . "dd26ac43cb60a" . "a2a7d97" => base64_decode("bGFzdF9tb2" . "RpZmllZA=="), "statu" . "s" => base64_decode("c3" . "Rh" . "dH" . "Vz"), "_f11369824f533e820" . "6f9ccc0c9aab3a0" => base64_decode("bGl" . "taX" . "Q="), "_1f50e30be8c2fefa6881834e7" . "1d504a2" => base64_decode("b2" . "Zm" . "c2" . "V0"), "_b8762acab332819f09c183233" . "ba40aa0" => base64_decode("T2Zmc2V0IGNhbm5vdCBiZSBsZXNzIHRoYW4gemVybyw" . "gJw=="), "_fabe7b83d4fd81224b2616ff5" . "9517e4f" => base64_decode("TGltaXQgbXVzdCBiZSBiZ" . "XR3ZWVuIDEgYW5kIA=="), "_f22ff2bb16ab37d1f01d" . "612e668e64d2" => base64_decode("LC" . "An"));
use Claromentis\Core\Security\SecurityContext;
use Date;
use InvalidArgumentException;
use Psr\Http\Message\ServerRequestInterface;




abstract class AbstractFilter
{
    public const MAX_LIMIT = 200;
    public const DEFAULT_LIMIT = 20;
    
    
    
    
    protected ?SecurityContext $context = null;
    protected int $limit = self::DEFAULT_LIMIT;
    protected int $offset = 0;
    protected ?Date $created_date = null;
    protected ?Date $modified_date = null;
    protected ?string $status = null;
    public function getContext() : ?SecurityContext
    {
        return $this->context;
    }
    public function setContext(?SecurityContext $context = null) : self
    {
        $this->context = $context;
        return $this;
    }
    public function getLimit() : int
    {
        return $this->limit;
    }
    
    
    
    
    
    
    
    
    public function setLimit(int $_f11369824f533e8206f9ccc0c9aab3a0) : self
    {
        if (!$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_62d701c3" . "c53404f06" . "345eb3572" . "0a47b4"]($_f11369824f533e8206f9ccc0c9aab3a0)) {
            throw new InvalidArgumentException($GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_977995ec9267e034bf7d84b69" . "939eaef"] . $_f11369824f533e8206f9ccc0c9aab3a0 . $GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_fa7fe9b4130" . "a69a5ebf1616" . "436603e27"]);
        }
        $_f11369824f533e8206f9ccc0c9aab3a0 = (int) $_f11369824f533e8206f9ccc0c9aab3a0;
        if ($_f11369824f533e8206f9ccc0c9aab3a0 <= 0 || $_f11369824f533e8206f9ccc0c9aab3a0 > self::MAX_LIMIT) {
            throw new InvalidArgumentException($GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_fabe7b83d4fd81224b2616ff59517e4" . "f"] . self::MAX_LIMIT . ($GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_f22ff2bb16ab37d1f01d612e668e64d" . "2"] . $_f11369824f533e8206f9ccc0c9aab3a0 . $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_fa7fe9b4130a69a5ebf" . "1616436603e27"]));
        } else {
            $this->limit = $_f11369824f533e8206f9ccc0c9aab3a0;
        }
        return $this;
    }
    public function getOffset() : int
    {
        return $this->offset;
    }
    
    
    
    
    
    
    
    
    public function setOffset(int $_1f50e30be8c2fefa6881834e71d504a2) : self
    {
        if (!$GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_62d701c3c53404f06345eb3572" . "0a47b4"]($_1f50e30be8c2fefa6881834e71d504a2)) {
            throw new InvalidArgumentException($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_fb092084478a617534a42360c8" . "8e0c9f"] . $_1f50e30be8c2fefa6881834e71d504a2 . $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_fa7fe9b4130a69a5ebf1616436" . "603e27"]);
        }
        $_1f50e30be8c2fefa6881834e71d504a2 = (int) $_1f50e30be8c2fefa6881834e71d504a2;
        if ($_1f50e30be8c2fefa6881834e71d504a2 < 0) {
            throw new InvalidArgumentException($GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_b8762acab332819f09c183" . "233ba40aa0"] . $_1f50e30be8c2fefa6881834e71d504a2 . $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_fa7fe9b4130a69a5ebf" . "1616436603e27"]);
        }
        $this->offset = $_1f50e30be8c2fefa6881834e71d504a2;
        return $this;
    }
    public function getCreatedDate() : ?Date
    {
        return $this->created_date;
    }
    public function setCreatedDate(?Date $_aa28ebaa9e17fc6a67b37600d92d6054)
    {
        $this->created_date = $_aa28ebaa9e17fc6a67b37600d92d6054;
    }
    public function getModifiedDate() : ?Date
    {
        return $this->modified_date;
    }
    public function setModifiedDate(?Date $_aeb918f309c1ac9bf44d7449ee69a709)
    {
        $this->modified_date = $_aeb918f309c1ac9bf44d7449ee69a709;
    }
    public function getStatus() : ?string
    {
        return $this->status;
    }
    public function setStatus(?string $status) : void
    {
        $this->status = $status;
    }
    
    
    
    
    
    
    
    
    public function setPaginationAttributesFromRequest(ServerRequestInterface $request) : void
    {
        $parameters = $request->getQueryParams();
        $_1f50e30be8c2fefa6881834e71d504a2 = isset($parameters[$GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_1f50e30be8c2fefa6881834" . "e71d504a2"]]) && $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_62d701c3c53404f06345eb35720a" . "47b4"]($parameters[$GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_1f50e30be" . "8c2fefa688" . "1834e71d50" . "4a2"]]) ? (int) $parameters[$GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_1f50e30be8c2fefa6881" . "834e71d504a2"]] : 0;
        $_f11369824f533e8206f9ccc0c9aab3a0 = isset($parameters[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_f11369824f533e8206f9ccc0c9aa" . "b3a0"]]) && $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_62d701c3c5340" . "4f06345eb35720" . "a47b4"]($parameters[$GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_f11369824f" . "533e8206f9c" . "cc0c9aab3a0"]]) ? (int) $parameters[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_f11369824f533e8206f9c" . "cc0c9aab3a0"]] : self::DEFAULT_LIMIT;
        $this->setOffset($_1f50e30be8c2fefa6881834e71d504a2);
        $this->setLimit($_f11369824f533e8206f9ccc0c9aab3a0);
    }
    
    
    
    
    
    
    public function toArray() : array
    {
        return [$GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_f11369824f533e820" . "6f9ccc0c9aab3a0"] => $this->limit, $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_1f50e30" . "be8c2fef" . "a6881834" . "e71d504a" . "2"] => $this->offset, $GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_aa28ebaa9e" . "17fc6a67b37" . "600d92d6054"] => $this->created_date, $GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_7608a2690229dd26ac43cb60aa" . "2a7d97"] => $this->modified_date, $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["statu" . "s"] => $this->status];
    }
}