<?php
namespace Claromentis\Quiz\Repository;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"] = (@$GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"] ?: array()) + array("_8a42f222cb28a825af25dc72fe29f7" . "38" => base64_decode("U0VMRUNUIHF1ZXN0aW9uX2lkIEZST00gcXVpel9wb2xs" . "X3F1ZXN0aW9uX2p1bmN0aW9u"), "_8e15a2079bcda2d8a31ad8c8acf" . "3caa3" => base64_decode("c29ydF9vcmRlciBBU0M" . "="), "_811bc2865e61b933fcf" . "bda9d4ffb755f" => base64_decode("cG9sbF9pZCA9IGludDpwb2xs" . "X2lk"), "_fb181f138b94816d72901c26" . "5594bc96" => base64_decode("cXVlc3Rpb25faWQgPSBpb" . "nQ6cXVlc3Rpb25faWQ="), "_0f7321019339ace6ad2e176" . "353d6bf0b" => base64_decode("YXJyYXlfd2F" . "saw=="), "_b3f8b52f21a9d" . "aef6ca01e7f18f" . "c132a" => base64_decode("IEFORCA" . "="));
use Claromentis\Core\DAL;
use Claromentis\Core\Event\EventDispatcher;
use Claromentis\Core\Repository\RepositoryItem;
use Claromentis\Quiz\Model;
use Claromentis\Core\Repository\Repository;




class PollQuestionRepository extends Repository
{
    protected $dispatcher;
    public function __construct(DAL\Db $_e87574de8e606d438c70d60ffb96ef44, RepositoryItem $_b15aac3aa29c10ea6d1228f58cb9a7e8, EventDispatcher $_b497ce6f2af10f67516aed0ecf34d8cf)
    {
        parent::__construct($_e87574de8e606d438c70d60ffb96ef44, $_b15aac3aa29c10ea6d1228f58cb9a7e8);
        $this->dispatcher = $_b497ce6f2af10f67516aed0ecf34d8cf;
    }
    
    
    
    
    
    
    public function ListJunctions($poll_id = 0, $question_id = 0) : array
    {
        $_9961f986823b4be7f5c4cc8379c6b228 = [];
        if ($poll_id) {
            $_9961f986823b4be7f5c4cc8379c6b228[] = new DAL\QueryPart($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_811bc2865" . "e61b933fcf" . "bda9d4ffb7" . "55f"], $poll_id);
        }
        if ($question_id) {
            $_9961f986823b4be7f5c4cc8379c6b228[] = new DAL\QueryPart($GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_fb181f138b94816d72901" . "c265594bc96"], $question_id);
        }
        $_6fc0a74a25d1fbb4c738bc7d5895bb02 = DAL\QueryBuilder::JoinQueryParts($GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_b3f8b52f21a9daef6" . "ca01e7f18fc132a"], $_9961f986823b4be7f5c4cc8379c6b228);
        $_7bd2e327358b9118697fb22256c36b61 = new DAL\QueryPart($_6fc0a74a25d1fbb4c738bc7d5895bb02);
        $_03e9164d0a343b742df4793268b80767 = DAL\QueryBuilder::BindQueryParts($_7bd2e327358b9118697fb22256c36b61, $_9961f986823b4be7f5c4cc8379c6b228);
        return $this->GetObjects($_03e9164d0a343b742df4793268b80767, $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_8e15a2079bcda2d8a31ad8c8acf3caa" . "3"]);
    }
    
    
    
    
    
    
    public function GetQuestionIds(int $poll_id) : array
    {
        $_30f942154645a3deca356c5cbdef7313 = new DAL\QueryBuilder($GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_8a42f222cb28a82" . "5af25dc72fe29f73" . "8"]);
        $_30f942154645a3deca356c5cbdef7313->AddWhereAndClause($GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_811bc2865e61" . "b933fcfbda9d4" . "ffb755f"], $poll_id);
        $_b4af1f7aa1ccde1a449e9d8afe15b753 = $this->db->query($_30f942154645a3deca356c5cbdef7313->GetQuery());
        
        
        $_d69bc5256e082f5dee25c2438a6ddc93 = $_b4af1f7aa1ccde1a449e9d8afe15b753->fetchAllValues();
        $GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_0f7321019" . "339ace6ad2" . "e176353d6b" . "f0b"]($_d69bc5256e082f5dee25c2438a6ddc93, function (&$_71f6a5b5840d77d6f5700b8129d32c14) {
            $_71f6a5b5840d77d6f5700b8129d32c14 = (int) $_71f6a5b5840d77d6f5700b8129d32c14;
        });
        return $_d69bc5256e082f5dee25c2438a6ddc93;
    }
    
    
    
    
    
    
    public function NewObject()
    {
        return parent::NewObject();
    }
}