<?php
namespace Claromentis\Quiz\Repository;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"] ?: array()) + array("_0f7321019339ace6ad2e17635" . "3d6bf0b" => base64_decode("YXJyYXlfd2F" . "saw=="), "_fb181f138b94816d72901c26559" . "4bc96" => base64_decode("cXVlc3Rpb25faWQgPSBpbnQ" . "6cXVlc3Rpb25faWQ="), "_8a42f222cb28a825" . "af25dc72fe29f738" => base64_decode("U0VMRUNUIHF1ZXN0aW9uX" . "2lkIEZST00gcXVpel9wb2" . "xsX3F1ZXN0aW9uX2p1bmN" . "0aW9u"), "_b3f8b52f21a9daef6ca01e7f18fc132" . "a" => base64_decode("IEFORC" . "A="), "_8e15a2079bcda2d8a31" . "ad8c8acf3caa3" => base64_decode("c29ydF9vcmRlciBBU0M" . "="), "_811bc2865e61b933fcfbd" . "a9d4ffb755f" => base64_decode("cG9sbF9pZCA9IGludD" . "pwb2xsX2lk"));
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["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_811bc2865e61b933fcfbda9d4ffb755" . "f"], $poll_id);
        }
        if ($question_id) {
            $_9961f986823b4be7f5c4cc8379c6b228[] = new DAL\QueryPart($GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_fb181f138b94816d72901c26559" . "4bc96"], $question_id);
        }
        $_6fc0a74a25d1fbb4c738bc7d5895bb02 = DAL\QueryBuilder::JoinQueryParts($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_b3f8b52f21a9daef6ca01e7" . "f18fc132a"], $_9961f986823b4be7f5c4cc8379c6b228);
        $_7bd2e327358b9118697fb22256c36b61 = new DAL\QueryPart($_6fc0a74a25d1fbb4c738bc7d5895bb02);
        $_03e9164d0a343b742df4793268b80767 = DAL\QueryBuilder::BindQueryParts($_7bd2e327358b9118697fb22256c36b61, $_9961f986823b4be7f5c4cc8379c6b228);
        return $this->GetObjects($_03e9164d0a343b742df4793268b80767, $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_8e15a2079bcda2d8a31ad8c8acf3" . "caa3"]);
    }
    
    
    
    
    
    
    public function GetQuestionIds(int $poll_id) : array
    {
        $_30f942154645a3deca356c5cbdef7313 = new DAL\QueryBuilder($GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_8a42f222cb28a825af25dc7" . "2fe29f738"]);
        $_30f942154645a3deca356c5cbdef7313->AddWhereAndClause($GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_811bc2865e6" . "1b933fcfbda9" . "d4ffb755f"], $poll_id);
        $_b4af1f7aa1ccde1a449e9d8afe15b753 = $this->db->query($_30f942154645a3deca356c5cbdef7313->GetQuery());
        
        
        $_d69bc5256e082f5dee25c2438a6ddc93 = $_b4af1f7aa1ccde1a449e9d8afe15b753->fetchAllValues();
        $GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_0f7321019339ace6ad2e176353d6bf0" . "b"]($_d69bc5256e082f5dee25c2438a6ddc93, function (&$_71f6a5b5840d77d6f5700b8129d32c14) {
            $_71f6a5b5840d77d6f5700b8129d32c14 = (int) $_71f6a5b5840d77d6f5700b8129d32c14;
        });
        return $_d69bc5256e082f5dee25c2438a6ddc93;
    }
    
    
    
    
    
    
    public function NewObject()
    {
        return parent::NewObject();
    }
}